Commit 4ea66446 authored by Knut's avatar Knut

meteo: save mean net heat fluxes (hfmean)

parent 41ae6e6b
......@@ -477,7 +477,7 @@
*(A(i,j)*exp(-zz/g1(i,j))+(1-A(i,j))*exp(-zz/g2(i,j)))
end do
end if
heatflux_net(i,j) = rad1d(kmax) - rad1d(0) + shf_loc
heatflux_net(i,j) = dry_z(i,j) * ( rad1d(kmax) - rad1d(0) + shf_loc )
do k=0,kmax
rad1d(k)=rad1d(k)*rho_0_cpi ! note this
end do
......
......@@ -223,6 +223,7 @@
#ifndef NO_BAROCLINIC
NN=_ZERO_
rad=_ZERO_
heatflux_net = _ZERO_
light=_ONE_
idpdx=_ZERO_
idpdy=_ZERO_
......
......@@ -18,6 +18,7 @@
use domain, only: imin,imax,jmin,jmax,kmax
use domain, only: vert_cord
use m3d, only: update_temp,update_salt
use meteo, only: metforcing
#ifdef GETM_BIO
use bio_var, only: numc,var_names,var_units,var_long
#endif
......@@ -88,14 +89,6 @@
call set_attributes(ncid,elevmean_id,long_name='mean elevation',units='m', &
FillValue=fv,missing_value=mv,valid_range=vr)
! short wave radiation
fv = swr_missing; mv = swr_missing; vr(1) = 0; vr(2) = 1500.
err = nf90_def_var(ncid,'swrmean',NCDF_FLOAT_PRECISION,f3_dims,swrmean_id)
if (err .NE. NF90_NOERR) go to 10
call set_attributes(ncid,swrmean_id, &
long_name='mean short wave radiation',units='W/m2', &
FillValue=fv,missing_value=mv,valid_range=vr)
! Ustar at bottom
fv = vel_missing; mv = vel_missing; vr(1) = -1; vr(2) = 1.
err = nf90_def_var(ncid,'ustarmean',NCDF_FLOAT_PRECISION,f3_dims,ustarmean_id)
......@@ -186,6 +179,16 @@
FillValue=fv,missing_value=mv,valid_range=vr)
end if
! net heat flux
if (metforcing) then
fv = hf_missing; mv = hf_missing; vr(1) = 0; vr(2) = 1500.
err = nf90_def_var(ncid,'hfmean',NCDF_FLOAT_PRECISION,f3_dims,hfmean_id)
if (err .NE. NF90_NOERR) go to 10
call set_attributes(ncid,hfmean_id, &
long_name='mean net heat flux',units='W/m2', &
FillValue=fv,missing_value=mv,valid_range=vr)
end if
#endif
if (do_numerical_analyses_3d) then
......
......@@ -20,13 +20,14 @@
integer :: time_dim
integer :: time_id
integer :: swrmean_id,ustarmean_id,ustar2mean_id
integer :: ustarmean_id,ustar2mean_id
integer :: elevmean_id
integer :: uumean_id,vvmean_id,wmean_id
integer :: hmean_id=-1
integer :: saltmean_id=-1
integer :: tempmean_id=-1
integer :: sigma_tmean_id=-1
integer :: hfmean_id=-1
integer :: nd3d_id=-1,nd3do_id=-1,pd3d_id=-1
integer :: ndint_id=-1,pdint_id=-1
integer :: nmS_id=-1
......@@ -45,7 +46,7 @@
REALTYPE, parameter :: elev_missing=-9999.0
REALTYPE, parameter :: hh_missing=-9999.0
REALTYPE, parameter :: swr_missing=-9999.0
REALTYPE, parameter :: hf_missing=-9999.0
REALTYPE, parameter :: vel_missing=-9999.0
REALTYPE, parameter :: salt_missing=-9999.0
REALTYPE, parameter :: temp_missing=-9999.0
......
......@@ -72,11 +72,15 @@
err = nf90_put_var(ncid,elevmean_id,ws2d(_2D_W_),start,edges)
if (err .NE. NF90_NOERR) go to 10
! Short wave radiation
call cnv_2d(imin,jmin,imax,jmax,az,swrmean,swr_missing, &
imin,jmin,imax,jmax,ws2d)
err = nf90_put_var(ncid,swrmean_id,ws2d(_2D_W_),start,edges)
if (err .NE. NF90_NOERR) go to 10
#ifndef NO_BAROCLINIC
! net heat flux
if (hfmean_id .ne. -1) then
call cnv_2d(imin,jmin,imax,jmax,az,hfmean,hf_missing, &
imin,jmin,imax,jmax,ws2d)
err = nf90_put_var(ncid,hfmean_id,ws2d(_2D_W_),start,edges)
if (err .NE. NF90_NOERR) go to 10
end if
#endif
! mean friction velocity
call cnv_2d(imin,jmin,imax,jmax,az,ustarmean,vel_missing, &
......
......@@ -12,12 +12,13 @@
! !USES:
use domain, only: imax,imin,jmax,jmin,kmax
use domain, only: az,au,av
use meteo, only: swr
use m3d, only: M,update_temp,update_salt
use meteo, only: metforcing
use variables_3d, only: do_numerical_analyses_3d
use variables_3d, only: ssen,hn,uu,hun,vv,hvn,ww,taub
#ifndef NO_BAROCLINIC
use variables_3d, only: S,T,rho
use variables_3d, only: heatflux_net
#endif
use variables_3d, only: nummix_S,nummix_T
use variables_3d, only: nummix_S_old,nummix_S_int,nummix_T_old,nummix_T_int
......@@ -62,9 +63,6 @@
if (first ) then
LEVEL3 'calc_mean_fields(): initialising variables'
allocate(swrmean(E2DFIELD),stat=rc)
if (rc /= 0) &
stop 'calc_mean_fields.F90: Error allocating memory (swrmean)'
allocate(ustarmean(E2DFIELD),stat=rc)
if (rc /= 0) &
stop 'calc_mean_fields.F90: Error allocating memory (ustarmean)'
......@@ -108,6 +106,11 @@
if (rc /= 0) &
stop 'calc_mean_fields.F90: Error allocating memory (rhomean)'
end if
if (metforcing) then
allocate(hfmean(E2DFIELD),stat=rc)
if (rc /= 0) &
stop 'calc_mean_fields.F90: Error allocating memory (hfmean)'
end if
#endif
if (do_numerical_analyses_3d) then
......@@ -207,6 +210,7 @@
if (save_t) Tmean=_ZERO_
if (save_s) Smean=_ZERO_
if (save_rho) rhomean=_ZERO_
if (metforcing) hfmean=_ZERO_
#endif
if (do_numerical_analyses_3d) then
numdis_3d_mean=_ZERO_
......@@ -240,10 +244,9 @@
fabmmean_diag_hz=_ZERO_
end if
#endif
ustarmean=_ZERO_; ustar2mean=_ZERO_; swrmean=_ZERO_
ustarmean=_ZERO_; ustar2mean=_ZERO_
end if
swrmean = swrmean + swr
! AS this has to be checked, if it is the correct ustar,
! so we must not divide by rho_0 !!
ustarmean = ustarmean + sqrt(taub)
......@@ -272,6 +275,7 @@
if (save_t) Tmean = Tmean + T*hn
if (save_s) Smean = Smean + S*hn
if (save_rho) rhomean = rhomean + rho*hn
if (metforcing) hfmean = hfmean + heatflux_net
#endif
if (do_numerical_analyses_3d) then
numdis_3d_mean = numdis_3d_mean + numdis_3d*hn
......@@ -331,6 +335,7 @@
if (save_t) Tmean = Tmean / step
if (save_s) Smean = Smean / step
if (save_rho) rhomean = rhomean / step
if (metforcing) hfmean = hfmean / step
#endif
if (do_numerical_analyses_3d) then
numdis_3d_mean = numdis_3d_mean / step / hmean
......@@ -371,7 +376,6 @@
end if
#endif
ustarmean = ustarmean / step
swrmean = swrmean / step
end if
......
......@@ -16,7 +16,7 @@
IMPLICIT NONE
!
! !PUBLIC DATA MEMBERS:
REALTYPE,dimension(:,:), allocatable :: swrmean
REALTYPE,dimension(:,:), allocatable :: hfmean
REALTYPE,dimension(:,:), allocatable :: ustarmean
REALTYPE,dimension(:,:), allocatable :: ustar2mean
REALTYPE,dimension(:,:), allocatable :: elevmean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment