69 use mpp_mod
, only: mpp_pe, mpp_root_pe,fatal,mpp_error
70 use constants_mod
, only: grav, rdgas
71 use fms_io_mod
, only: set_domain, nullify_domain
72 use time_manager_mod
, only: time_type, get_time
73 use diag_manager_mod
, only: register_diag_field, send_data
74 use diag_axis_mod
, only: get_axis_global_length, get_diag_axis, get_diag_axis_name
75 use diag_data_mod
, only: output_fields, max_output_fields
76 use diag_util_mod
, only: find_input_field
77 use tracer_manager_mod
, only: get_tracer_names, get_number_tracers, get_tracer_index
78 use field_manager_mod
, only: model_atmos
83 use mpp_domains_mod
, only: domain1d, domainug
119 real,
allocatable ::
ak(:),
bk(:)
129 real ::
skrange(2) = (/ -10000000.0, 10000000.0 /)
140 real(4),
dimension(:,:,:,:),
allocatable,
target ::
windvect 141 real(4),
dimension(:,:),
allocatable,
target ::
psurf 142 real,
dimension(:,:),
allocatable ::
lon,
lat 148 public :: fv_dyn_bundle_setup
155 integer,
intent(in) :: axes(4)
156 type(time_type),
intent(in) :: Time
157 integer :: n, i, j, nz
162 isco = atm(n)%bd%isc;
ieco = atm(n)%bd%iec
163 jsco = atm(n)%bd%jsc;
jeco = atm(n)%bd%jec
164 isdo = atm(n)%bd%isd;
iedo = atm(n)%bd%ied
165 jsdo = atm(n)%bd%jsd;
jedo = atm(n)%bd%jed
168 call set_domain(atm(1)%domain)
170 sphum = get_tracer_index(model_atmos,
'sphum')
171 liq_wat = get_tracer_index(model_atmos,
'liq_wat')
172 ice_wat = get_tracer_index(model_atmos,
'ice_wat')
174 rainwat = get_tracer_index(model_atmos,
'rainwat')
175 snowwat = get_tracer_index(model_atmos,
'snowwat')
176 graupel = get_tracer_index(model_atmos,
'graupel')
187 if (atm(n)%flagstruct%write_3d_diags)
then 191 id_ua = register_diag_field( trim(
file_name),
'ucomp', axes(1:3), time, &
198 id_va = register_diag_field( trim(
file_name),
'vcomp', axes(1:3), time, &
211 if( atm(n)%flagstruct%hydrostatic )
then 225 id_w = register_diag_field( trim(
file_name),
'w', axes(1:3), time, &
246 id_pt = register_diag_field( trim(
file_name),
'temp', axes(1:3), time, &
261 id_diss = register_diag_field( trim(
file_name),
'diss_est', axes(1:3), time, &
282 id_ps = register_diag_field( trim(
file_name),
'ps', axes(1:2), time, &
290 id_hs = register_diag_field( trim(
file_name),
'hs', axes(1:2), time, &
297 id_dbz = register_diag_field( trim(
file_name),
'reflectivity', axes(1:3), time, &
367 if( .not.atm(n)%flagstruct%hydrostatic .and.
id_uhmax03 > 0 )
then 375 if( .not.atm(n)%flagstruct%hydrostatic .and.
id_uhmin03 > 0 )
then 383 if( .not.atm(n)%flagstruct%hydrostatic .and.
id_uhmax25 > 0 )
then 391 if( .not.atm(n)%flagstruct%hydrostatic .and.
id_uhmin25 > 0 )
then 407 if(.not.
allocated(
lon))
then 411 lon(i,j) = atm(n)%gridstruct%agrid(i,j,1)
416 if(.not.
allocated(
lat))
then 420 lat(i,j) = atm(n)%gridstruct%agrid(i,j,2)
438 real,
intent(in):: zvir
439 type(time_type),
intent(in) :: Time
441 integer :: i, j, k, n, ngc, nq, itrac
444 real,
allocatable :: wk(:,:,:), wk2(:,:,:)
445 real,
dimension(:,:),
allocatable :: ustm,vstm,srh01,srh03
451 nq =
size (atm(n)%q,4)
458 if ( atm(n)%flagstruct%range_warn )
then 460 0.01*ptop, 200.e2, bad_range)
462 -250., 250., bad_range)
464 -250., 250., bad_range)
466 150., 350., bad_range)
479 windvect(1,i,j,k) = atm(n)%ua(i,j,k)*cos(
lon(i,j)) - atm(n)%va(i,j,k)*sin(
lat(i,j))*sin(
lon(i,j))
480 windvect(2,i,j,k) = atm(n)%ua(i,j,k)*sin(
lon(i,j)) + atm(n)%va(i,j,k)*sin(
lat(i,j))*cos(
lon(i,j))
488 if ( .not.atm(n)%flagstruct%hydrostatic .and.
id_w>0 )
then 502 call get_tracer_names (model_atmos, itrac,
tname)
503 if (
id_tracer(itrac) > 0 .and. itrac.gt.nq)
then 513 if((.not. atm(n)%flagstruct%hydrostatic) .and.
id_delz > 0)
then 517 wk(i,j,k) = atm(n)%delz(i,j,k)
525 if( atm(n)%flagstruct%hydrostatic .and.
id_pfhy > 0 )
then 529 wk(i,j,k) = 0.5 *(atm(n)%pe(i,k,j)+atm(n)%pe(i,k+1,j))
538 if(
id_delp > 0 .or. ((.not. atm(n)%flagstruct%hydrostatic) .and.
id_pfnh > 0))
then 542 wk(i,j,k) = atm(n)%delp(i,j,k)*(1.-sum(atm(n)%q(i,j,k,2:atm(n)%flagstruct%nwat)))
555 wk(i,j,k) = atm(n)%delp(i,j,k)*(1.-sum(atm(n)%q(i,j,k,2:atm(n)%flagstruct%nwat)))
570 if( (.not. atm(n)%flagstruct%hydrostatic) .and.
id_pfnh > 0)
then 574 wk(i,j,k) = -wk(i,j,k)/(atm(n)%delz(i,j,k)*grav)*rdgas*atm(n)%pt(i,j,k)
576 wk(i,j,k) = wk(i,j,k) *
virq(atm(n)%q(i,j,k,:))
578 wk(i,j,k) = wk(i,j,k) * (1.+zvir*atm(n)%q(i,j,k,
sphum))
593 psurf(i,j) = atm(n)%ps(i,j)
599 if( (.not. atm(n)%flagstruct%hydrostatic) .and.
id_pfnh > 0)
then 603 wk(i,j,k) = -atm(n)%delp(i,j,k)/(atm(n)%delz(i,j,k)*grav)*rdgas*atm(n)%pt(i,j,k)
605 wk(i,j,k) = wk(i,j,k)*
virq(atm(n)%q(i,j,k,:)
607 wk(i,j,k) = wk(i,j,k)*(1.+zvir*atm(n)%q(i,j,k,
sphum))
629 wk(i,j,1) =
psurf(i,j)
641 wk(i,j,1) = atm(n)%phis(i,j)/grav
649 call dbzcalc(atm(n)%q, atm(n)%pt, atm(n)%delp, atm(n)%peln, atm(n)%delz, &
650 wk, wk2, allmax, atm(n)%bd,
npzo, atm(n)%ncnst, atm(n)%flagstruct%hydrostatic, &
651 zvir, .false., .false., .false., .true. )
659 call bunkers_vector(
isco,
ieco,
jsco,
jeco,ngc,
npzo,zvir,
sphum,ustm,vstm, &
660 atm(n)%ua,atm(n)%va, atm(n)%delz, atm(n)%q, &
661 atm(n)%flagstruct%hydrostatic, atm(n)%pt, atm(n)%peln,&
665 ustm, vstm,atm(n)%ua, atm(n)%va, atm(n)%delz, &
666 atm(n)%q,atm(n)%flagstruct%hydrostatic, &
667 atm(n)%pt, atm(n)%peln, atm(n)%phis, grav, 0., 1.e3)
670 ustm, vstm,atm(n)%ua, atm(n)%va, atm(n)%delz, &
671 atm(n)%q,atm(n)%flagstruct%hydrostatic, &
672 atm(n)%pt, atm(n)%peln, atm(n)%phis, grav, 0., 3.e3)
679 print *,
'Missing fields in diag_table' 680 print *,
'Make sure the following are listed in the diag_table under gfs_dyn:' 681 print *,
'ustm,vstm,srh01,shr03' 682 call mpp_error(fatal,
'Missing fields in diag_table')
713 if ( .not.atm(n)%flagstruct%hydrostatic .and.
id_uhmax03 > 0)
then 718 if ( .not.atm(n)%flagstruct%hydrostatic .and.
id_uhmin03 > 0)
then 723 if ( .not.atm(n)%flagstruct%hydrostatic .and.
id_uhmax25 > 0)
then 728 if ( .not.atm(n)%flagstruct%hydrostatic .and.
id_uhmin25 > 0)
then 732 call nullify_domain()
736 subroutine fv_nggps_tavg(Atm, Time_step_atmos,avg_max_length,zvir)
738 type(time_type),
intent(in) :: Time_step_atmos
739 real,
intent(in):: zvir
740 integer :: i, j, k, n, ngc, nq, itrac
741 integer seconds, days, nsteps_per_reset
742 logical,
save :: first_call=.true.
743 real,
save :: first_time = 0.
744 integer,
save :: kdtt = 0
745 real :: avg_max_length
746 real,
dimension(:,:,:),
allocatable :: vort
749 nq =
size (atm(n)%q,4)
764 call get_time (time_step_atmos, seconds, days)
769 nsteps_per_reset = nint(avg_max_length/first_time)
772 if(mod(kdtt,nsteps_per_reset)==0)
then 782 npzo,atm(n)%u,atm(n)%v,vort, &
783 atm(n)%gridstruct%dx,atm(n)%gridstruct%dy,&
784 atm(n)%gridstruct%rarea)
787 sphum,atm(n)%delz,atm(n)%q, &
788 atm(n)%flagstruct%hydrostatic, &
789 atm(n)%pt,atm(n)%peln,atm(n)%phis,grav, &
792 sphum,atm(n)%delz,atm(n)%q, &
793 atm(n)%flagstruct%hydrostatic, &
794 atm(n)%pt,atm(n)%peln,atm(n)%phis,grav, &
796 if( .not.atm(n)%flagstruct%hydrostatic )
then 800 if(mod(kdtt,nsteps_per_reset)==0)
then 811 atm(n)%q,atm(n)%flagstruct%hydrostatic, &
812 atm(n)%pt,atm(n)%peln,atm(n)%phis,grav, &
816 atm(n)%q,atm(n)%flagstruct%hydrostatic, &
817 atm(n)%pt,atm(n)%peln,atm(n)%phis,grav, &
823 print *,
'Missing max/min hourly field in diag_table' 824 print *,
'Make sure the following are listed in the diag_table under gfs_dyn:' 825 print *,
'wmaxup,wmaxdn,uhmax03,uhmin03,uhmax25,uhmin25,maxvort01,maxvort02 and maxvorthy1' 826 call mpp_error(fatal,
'Missing max hourly fields in diag_table')
832 subroutine store_data(id, work, Time, nstt, nend)
833 integer,
intent(in) :: id
834 integer,
intent(in) :: nstt, nend
836 type(time_type),
intent(in) :: Time
852 used = send_data(id, work, time)
860 subroutine fv_dyn_bundle_setup(axes, dyn_bundle, fcst_grid, quilting, rc)
867 use diag_data_mod
, ONLY: diag_atttype
869 integer,
intent(in) :: axes(:)
870 type(esmf_fieldbundle),
intent(inout) :: dyn_bundle
871 type(esmf_grid),
intent(inout) :: fcst_grid
872 logical,
intent(in) :: quilting
873 integer,
intent(out) :: rc
878 integer num_axes, id, axis_length, direction, edges
879 integer num_attributes, num_field_dyn, axis_typ
880 character(255) :: units, long_name, cart_name,axis_direct,edgesS
881 character(128) :: output_name, output_file, output_file1, dynbdl_name, shydrostatic
882 integer currdate(6), idx1
884 type(domain1d) :: Domain
885 type(domainug) :: DomainU
886 real,
dimension(:),
allocatable :: axis_data
887 type(diag_atttype),
dimension(:),
allocatable :: attributes
890 type(esmf_field) :: field
912 call esmf_fieldbundleget(dyn_bundle, name=dynbdl_name,rc=rc)
913 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
917 idx1 = index(dynbdl_name,
'_bilinear')
919 output_file = dynbdl_name(1:idx1-1)
930 num_axes =
size(axes)
932 all_axes(1:num_axes) = axes(1:num_axes)
936 call esmf_attributeadd(dyn_bundle, convention=
"NetCDF", purpose=
"FV3", &
937 attrlist=(/
"hydrostatic", &
941 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
946 shydrostatic =
'hydrostatic' 948 shydrostatic =
'non-hydrostatic' 950 call esmf_attributeset(dyn_bundle, convention=
"NetCDF", purpose=
"FV3", &
951 name=
"hydrostatic",
value=trim(shydrostatic), rc=rc)
952 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
957 call esmf_attributeset(dyn_bundle, convention=
"NetCDF", purpose=
"FV3", &
958 name=
"ncnsto",
value=
ncnsto, rc=rc)
959 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
964 call esmf_attributeset(dyn_bundle, convention=
"NetCDF", purpose=
"FV3", &
965 name=
"ak", valuelist=
ak, rc=rc)
967 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
972 call esmf_attributeset(dyn_bundle, convention=
"NetCDF", purpose=
"FV3", &
973 name=
"bk", valuelist=
bk, rc=rc)
975 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
983 call get_diag_axis_name( axes(id),
axis_name(id))
985 if( num_axes>2 )
then 991 call esmf_attributeadd(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
992 attrlist=(/
"vertical_dim_labels"/), rc=rc)
993 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
997 call esmf_attributeset(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
999 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1006 axis_length = get_axis_global_length(axes(id))
1007 allocate(axis_data(axis_length))
1008 call get_diag_axis( axes(id),
axis_name(id), units, long_name, cart_name, &
1009 direction, edges, domain, domainu, axis_data, &
1010 num_attributes=num_attributes, &
1011 attributes=attributes)
1015 if(axes(i) == edges) edgess=
axis_name(i)
1043 call esmf_attributeadd(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1044 attrlist=(/trim(
axis_name(id))/), rc=rc)
1045 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1049 call esmf_attributeadd(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1050 attrlist=(/trim(
axis_name(id))//
":long_name"/), rc=rc)
1051 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1055 call esmf_attributeadd(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1056 attrlist=(/trim(
axis_name(id))//
":units"/), rc=rc)
1057 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1061 call esmf_attributeadd(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1062 attrlist=(/trim(
axis_name(id))//
":cartesian_axis"/), rc=rc)
1063 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1067 call esmf_attributeadd(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1068 attrlist=(/trim(
axis_name(id))//
":positive"/), rc=rc)
1069 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1073 if(trim(edgess)/=
'')
then 1074 call esmf_attributeadd(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1075 attrlist=(/trim(
axis_name(id))//
":edges"/), rc=rc)
1076 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1082 call esmf_attributeset(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1083 name=trim(
axis_name(id)), valuelist=axis_data, rc=rc)
1084 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1088 call esmf_attributeset(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1089 name=trim(
axis_name(id))//
":long_name",
value=trim(long_name), rc=rc)
1090 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1094 call esmf_attributeset(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1095 name=trim(
axis_name(id))//
":units",
value=trim(units), rc=rc)
1096 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1100 call esmf_attributeset(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1101 name=trim(
axis_name(id))//
":cartesian_axis",
value=trim(cart_name), rc=rc)
1102 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1106 if(direction>0)
then 1111 call esmf_attributeset(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1112 name=trim(
axis_name(id))//
":positive",
value=trim(axis_direct), rc=rc)
1113 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1117 if(trim(edgess)/=
'')
then 1118 call esmf_attributeset(fcst_grid, convention=
"NetCDF", purpose=
"FV3", &
1119 name=trim(
axis_name(id))//
":edges",
value=trim(edgess), rc=rc)
1120 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1128 deallocate(axis_data)
1133 call find_outputname(trim(
file_name),
'ucomp',output_name)
1135 call add_field_to_bundle(trim(output_name),
'zonal wind',
'm/sec',
"time: point", &
1136 axes(1:3), fcst_grid,
kstt_ua,
kend_ua, dyn_bundle, output_file, &
1138 if(rc==0) num_field_dyn=num_field_dyn+1
1142 call find_outputname(trim(
file_name),
'vcomp',output_name)
1143 call add_field_to_bundle(trim(output_name),
'meridional wind',
'm/sec',
"time: point", &
1144 axes(1:3), fcst_grid,
kstt_va,
kend_va, dyn_bundle, output_file, &
1146 if(rc==0) num_field_dyn=num_field_dyn+1
1151 output_name =
"windvector" 1152 output_file1 =
'none' 1154 call add_field_to_bundle(trim(output_name),
'3D cartisian wind vector',
'm/sec',
"time: point", &
1156 l3dvector=l3dvector,rcd=rc)
1161 call find_outputname(trim(
file_name),
'w',output_name)
1162 call add_field_to_bundle(trim(output_name),
'vertical wind',
'm/sec',
"time: point", &
1163 axes(1:3), fcst_grid,
kstt_w,
kend_w, dyn_bundle, output_file, &
1165 if(rc==0) num_field_dyn=num_field_dyn+1
1168 call find_outputname(trim(
file_name),
'pfnh',output_name)
1169 call add_field_to_bundle(trim(output_name),
'non-hydrostatic pressure',
'pa',
"time: point", &
1171 if(rc==0) num_field_dyn=num_field_dyn+1
1174 call find_outputname(trim(
file_name),
'delz',output_name)
1175 call add_field_to_bundle(trim(output_name),
'height thickness',
'm',
"time: point", &
1177 if(rc==0) num_field_dyn=num_field_dyn+1
1181 call find_outputname(trim(
file_name),
'pfhy',output_name)
1182 call add_field_to_bundle(trim(output_name),
'hydrostatic pressure',
'pa',
"time: point", &
1184 if(rc==0) num_field_dyn=num_field_dyn+1
1189 call find_outputname(trim(
file_name),
'omga',output_name)
1190 call add_field_to_bundle(trim(output_name),
'Vertical pressure velocity',
'pa/sec',
"time: point", &
1192 if(rc==0) num_field_dyn=num_field_dyn+1
1196 call find_outputname(trim(
file_name),
'temp',output_name)
1197 call add_field_to_bundle(trim(output_name),
'temperature',
'K',
"time: point", &
1198 axes(1:3), fcst_grid,
kstt_pt,
kend_pt, dyn_bundle, output_file, &
1200 if(rc==0) num_field_dyn=num_field_dyn+1
1204 call find_outputname(trim(
file_name),
'delp',output_name)
1205 call add_field_to_bundle(trim(output_name),
'pressure thickness',
'pa',
"time: point", &
1207 if(rc==0) num_field_dyn=num_field_dyn+1
1215 call add_field_to_bundle(trim(output_name),trim(
tlongname), trim(
tunits),
"time: point", &
1217 if(rc==0) num_field_dyn=num_field_dyn+1
1224 call find_outputname(trim(
file_name),
'ps',output_name)
1225 call add_field_to_bundle(trim(output_name),
'surface pressure',
'pa',
"time: point", &
1226 axes(1:2), fcst_grid,
kstt_ps,
kend_ps, dyn_bundle, output_file, rcd=rc)
1227 if(rc==0) num_field_dyn=num_field_dyn+1
1231 call find_outputname(trim(
file_name),
'hs',output_name)
1232 call add_field_to_bundle(trim(output_name),
'surface geopotential height',
'gpm',
"time: point", &
1233 axes(1:2), fcst_grid,
kstt_hs,
kend_hs, dyn_bundle, output_file, rcd=rc)
1234 if(rc==0) num_field_dyn=num_field_dyn+1
1238 call find_outputname(trim(
file_name),
'reflectivity',output_name)
1240 call add_field_to_bundle(trim(output_name),
'Stoelinga simulated reflectivity',
'dBz',
"time: point", &
1242 if(rc==0) num_field_dyn=num_field_dyn+1
1245 call find_outputname(trim(
file_name),
'ustm',output_name)
1246 if(mpp_pe()==mpp_root_pe())print *,
'u comp. of storm motion, output name=',trim(output_name)
1247 call add_field_to_bundle(trim(output_name),
'u comp of storm motion',
'm/s',
"time: point", &
1249 if(rc==0) num_field_dyn=num_field_dyn+1
1251 call find_outputname(trim(
file_name),
'vstm',output_name)
1252 if(mpp_pe()==mpp_root_pe())print *,
'v comp. of storm motion, output name=',trim(output_name)
1253 call add_field_to_bundle(trim(output_name),
'v comp of storm motion',
'm/s',
"time: point", &
1255 if(rc==0) num_field_dyn=num_field_dyn+1
1257 call find_outputname(trim(
file_name),
'srh01',output_name)
1258 if(mpp_pe()==mpp_root_pe())print *,
'0-1km srh, output name=',trim(output_name)
1259 call add_field_to_bundle(trim(output_name),
'0-1km srh',
'm/s**2',
"time: point", &
1261 if(rc==0) num_field_dyn=num_field_dyn+1
1263 call find_outputname(trim(
file_name),
'srh03',output_name)
1264 if(mpp_pe()==mpp_root_pe())print *,
'0-3km srh, output name=',trim(output_name)
1265 call add_field_to_bundle(trim(output_name),
'0-3km srh',
'm/s**2',
"time: point", &
1267 if(rc==0) num_field_dyn=num_field_dyn+1
1272 call find_outputname(trim(
file_name),
'maxvort01',output_name)
1273 if(mpp_pe()==mpp_root_pe())print *,
'max hourly 0-1km vert. vorticity, output name=',trim(output_name)
1274 call add_field_to_bundle(trim(output_name),
'Max hourly 0-1km vert. vorticity',
'1/s',
"time: point", &
1276 if(rc==0) num_field_dyn=num_field_dyn+1
1279 call find_outputname(trim(
file_name),
'maxvort02',output_name)
1280 if(mpp_pe()==mpp_root_pe())print *,
'max hourly 0-2km vert. vorticity, output name=',trim(output_name)
1281 call add_field_to_bundle(trim(output_name),
'Max hourly 0-2km vert. vorticity',
'1/s',
"time: point", &
1283 if(rc==0) num_field_dyn=num_field_dyn+1
1286 call find_outputname(trim(
file_name),
'maxvorthy1',output_name)
1287 if(mpp_pe()==mpp_root_pe())print *,
'max hourly lev 1 vert. vorticity output name=',trim(output_name)
1288 call add_field_to_bundle(trim(output_name),
'Max hourly lev 1 vert vort.',
'1/s',
"time: point", &
1290 if(rc==0) num_field_dyn=num_field_dyn+1
1293 call find_outputname(trim(
file_name),
'wmaxup',output_name)
1294 if(mpp_pe()==mpp_root_pe())print *,
'max hourly updraft vel, output name=',trim(output_name)
1295 call add_field_to_bundle(trim(output_name),
'Max hourly updraft velocity',
'm/s',
"time: point", &
1297 if(rc==0) num_field_dyn=num_field_dyn+1
1300 call find_outputname(trim(
file_name),
'wmaxdn',output_name)
1301 if(mpp_pe()==mpp_root_pe())print *,
'max hourly downdraft vel, output name=',trim(output_name)
1302 call add_field_to_bundle(trim(output_name),
'Max hourly downdraft velocity',
'm/s',
"time: point", &
1304 if(rc==0) num_field_dyn=num_field_dyn+1
1307 call find_outputname(trim(
file_name),
'uhmax03',output_name)
1308 if(mpp_pe()==mpp_root_pe())print *,
'max hourly 0-3km updraft helicity, output name=',trim(output_name)
1309 call add_field_to_bundle(trim(output_name),
'Max hourly 0-3km updraft helicity',
'm/s**2',
"time: point", &
1311 if(rc==0) num_field_dyn=num_field_dyn+1
1314 call find_outputname(trim(
file_name),
'uhmin03',output_name)
1315 if(mpp_pe()==mpp_root_pe())print *,
'max hourly 0-3km updraft helicity, output name=',trim(output_name)
1316 call add_field_to_bundle(trim(output_name),
'Max hourly 0-3km updraft helicity',
'm/s**2',
"time: point", &
1318 if(rc==0) num_field_dyn=num_field_dyn+1
1321 call find_outputname(trim(
file_name),
'uhmax25',output_name)
1322 if(mpp_pe()==mpp_root_pe())print *,
'max hourly 2-5km updraft helicity, output name=',trim(output_name)
1323 call add_field_to_bundle(trim(output_name),
'Max hourly 2-5km updraft helicity',
'm/s**2',
"time: point", &
1325 if(rc==0) num_field_dyn=num_field_dyn+1
1328 call find_outputname(trim(
file_name),
'uhmin25',output_name)
1329 if(mpp_pe()==mpp_root_pe())print *,
'max hourly 2-5km updraft helicity, output name=',trim(output_name)
1330 call add_field_to_bundle(trim(output_name),
'Max hourly 2-5km updraft helicity',
'm/s**2',
"time: point", &
1332 if(rc==0) num_field_dyn=num_field_dyn+1
1346 end subroutine fv_dyn_bundle_setup
1348 subroutine add_field_to_bundle(var_name,long_name,units,cell_methods, axes,dyn_grid, &
1349 kstt,kend,dyn_bundle,output_file, range, l3Dvector, rcd)
1353 character(*),
intent(in) :: var_name, long_name, units, cell_methods
1354 integer,
intent(in) :: axes(:)
1355 type(esmf_grid),
intent(in) :: dyn_grid
1356 integer,
intent(in) :: kstt,kend
1357 type(esmf_fieldbundle),
intent(inout) :: dyn_bundle
1358 character(*),
intent(in) :: output_file
1359 real,
intent(in),
optional :: range(2)
1360 logical,
intent(in),
optional :: l3Dvector
1361 integer,
intent(out),
optional :: rcd
1364 type(esmf_field) :: field
1365 type(esmf_datacopy_flag) :: copyflag=esmf_datacopy_reference
1366 integer rc, i, j, idx
1367 real(4),
dimension(:,:,:,:),
pointer :: temp_r4d
1368 real(4),
dimension(:,:,:),
pointer :: temp_r3d
1369 real(4),
dimension(:,:),
pointer :: temp_r2d
1370 logical,
save :: first=.true.
1373 if(
present(l3dvector) )
then 1375 call esmf_logwrite(
'create winde vector esmf field', esmf_logmsg_info, rc=rc)
1376 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1381 field = esmf_fieldcreate(dyn_grid, temp_r4d, datacopyflag=esmf_datacopy_reference, &
1382 gridtofieldmap=(/2,3/), ungriddedlbound=(/1,kstt/), ungriddedubound=(/3,kend/), &
1383 name=
"windvector", indexflag=esmf_index_delocal, rc=rc)
1384 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1388 call esmf_logwrite(
'create winde vector esmf field', esmf_logmsg_info, rc=rc)
1389 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1394 call esmf_attributeadd(field, convention=
"NetCDF", purpose=
"FV3", &
1395 attrlist=(/
"output_file"/), rc=rc)
1396 call esmf_attributeset(field, convention=
"NetCDF", purpose=
"FV3", &
1397 name=
'output_file',
value=trim(output_file),rc=rc)
1399 call esmf_fieldbundleadd(dyn_bundle,(/field/), rc=rc)
1400 if(
present(rcd)) rcd=rc
1402 else if( kend>kstt )
then 1404 field = esmf_fieldcreate(dyn_grid, temp_r3d, datacopyflag=copyflag, &
1405 name=var_name, indexflag=esmf_index_delocal, rc=rc)
1406 else if(kend==kstt)
then 1408 field = esmf_fieldcreate(dyn_grid, temp_r2d, datacopyflag=copyflag, &
1409 name=var_name, indexflag=esmf_index_delocal, rc=rc)
1413 call esmf_attributeadd(field, convention=
"NetCDF", purpose=
"FV3", &
1414 attrlist=(/
"long_name"/), rc=rc)
1415 call esmf_attributeset(field, convention=
"NetCDF", purpose=
"FV3", &
1416 name=
'long_name',
value=trim(long_name),rc=rc)
1418 call esmf_attributeadd(field, convention=
"NetCDF", purpose=
"FV3", &
1419 attrlist=(/
"units"/), rc=rc)
1420 call esmf_attributeset(field, convention=
"NetCDF", purpose=
"FV3", &
1421 name=
'units',
value=trim(units),rc=rc)
1423 call esmf_attributeadd(field, convention=
"NetCDF", purpose=
"FV3", &
1424 attrlist=(/
"missing_value"/), rc=rc)
1425 call esmf_attributeset(field, convention=
"NetCDF", purpose=
"FV3", &
1428 call esmf_attributeadd(field, convention=
"NetCDF", purpose=
"FV3", &
1429 attrlist=(/
"_FillValue"/), rc=rc)
1430 call esmf_attributeset(field, convention=
"NetCDF", purpose=
"FV3", &
1433 call esmf_attributeadd(field, convention=
"NetCDF", purpose=
"FV3", &
1434 attrlist=(/
"cell_methods"/), rc=rc)
1435 call esmf_attributeset(field, convention=
"NetCDF", purpose=
"FV3", &
1436 name=
'cell_methods',
value=trim(cell_methods),rc=rc)
1438 call esmf_attributeadd(field, convention=
"NetCDF", purpose=
"FV3", &
1439 attrlist=(/
"output_file"/), rc=rc)
1440 call esmf_attributeset(field, convention=
"NetCDF", purpose=
"FV3", &
1441 name=
'output_file',
value=trim(output_file),rc=rc)
1444 if(
size(axes) > 2)
then 1454 call esmf_attributeadd(field, convention=
"NetCDF", purpose=
"FV3", &
1455 attrlist=(/
"ESMF:ungridded_dim_labels"/), rc=rc)
1456 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1460 call esmf_attributeset(field, convention=
"NetCDF", purpose=
"FV3", &
1461 name=
"ESMF:ungridded_dim_labels", valuelist=(/trim(
axis_name(idx))/), rc=rc)
1465 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
1475 call esmf_fieldbundleadd(dyn_bundle,(/field/), rc=rc)
1476 if(
present(rcd)) rcd=rc
1478 end subroutine add_field_to_bundle
1480 subroutine find_outputname(module_name, field_name, output_name)
1481 character(*),
intent(in) :: module_name
1482 character(*),
intent(in) :: field_name
1483 character(*),
intent(out) :: output_name
1485 integer i,j,in_num, out_num
1489 in_num = find_input_field(module_name, field_name, tile_count)
1492 do i=1, max_output_fields
1493 if(output_fields(i)%input_field == in_num)
then 1494 output_name=output_fields(i)%output_name
1498 if(output_name==
'')
then 1499 print *,
'Error, cant find out put name, field_name=',trim(field_name),
'in_num=',in_num
1502 end subroutine find_outputname
character(len=256) tlongname
logical module_is_initialized
real, dimension(:,:), allocatable maxvorthy1
subroutine store_data(id, work, Time, nstt, nend)
real, dimension(2) vrange
winds
subroutine, public max_uh(is, ie, js, je, ng, km, zvir, sphum, uphmax, uphmin, w, vort, delz, q, hydrostatic, pt, peln, phis, grav, z_bot, z_top)
real, dimension(:), allocatable bk
real, dimension(:,:), allocatable maxvort02
real, dimension(:,:), allocatable lat
subroutine, public fv_nggps_tavg(Atm, Time_step_atmos, avg_max_length, zvir)
The module 'multi_gases' peforms multi constitutents computations.
logical use_wrtgridcomp_output
real, dimension(:,:), allocatable uhmin25
real, parameter stndrd_atmos_lapse
real, dimension(:), allocatable ak
real, dimension(:,:), allocatable dn2
subroutine, public bunkers_vector(is, ie, js, je, ng, km, zvir, sphum, uc, vc, ua, va, delz, q, hydrostatic, pt, peln, phis, grav)
integer ice_wat
GFDL physics.
integer, dimension(:), allocatable all_axes
subroutine, public max_vorticity_hy1(is, ie, js, je, km, vort, maxvorthy1)
integer, dimension(:), allocatable id_tracer
pure real function, public virq(q)
integer, dimension(:), allocatable kend_tracer
The module 'fv_nggps_diags' computes output diagnostics entirely on 3D pressure levels.
real, dimension(:,:), allocatable lon
real(4), dimension(:,:,:,:), allocatable, target windvect
subroutine, public fv_nggps_diag(Atm, zvir, Time)
character(len=256) tunits
real, dimension(:,:), allocatable uhmax03
real, dimension(:,:), allocatable maxvort01
subroutine, public fv_nggps_diag_init(Atm, axes, Time)
The module 'fv_arrays' contains the 'fv_atmos_type' and associated datatypes.
real(4), dimension(:,:), allocatable, target psurf
real, dimension(:,:), allocatable uhmin03
character(20), dimension(:), allocatable axis_name
real, parameter stndrd_atmos_ps
real, dimension(:,:), allocatable up2
real, dimension(2) trange
temperature
integer, dimension(:), allocatable kstt_tracer
subroutine, public dbzcalc(q, pt, delp, peln, delz, dbz, maxdbz, allmax, bd, npz, ncnst, hydrostatic, zvir, in0r, in0s, in0g, iliqskin)
The subroutine 'dbzcalc' computes equivalent reflectivity factor (in dBZ) at each model grid point...
character(len=64) file_name
@ The module 'fv_diagnostics' contains routines to compute diagnosic fields.
real, dimension(2) skrange
dissipation estimate for SKEB
subroutine, public helicity_relative_caps(is, ie, js, je, ng, km, zvir, sphum, srh, uc, vc, ua, va, delz, q, hydrostatic, pt, peln, phis, grav, z_bot, z_top)
subroutine, public max_vorticity(is, ie, js, je, ng, km, zvir, sphum, delz, q, hydrostatic, pt, peln, phis, grav, vort, maxvort, z_bot, z_top)
real, dimension(2) wrange
vertical wind
real(4), dimension(:,:,:), allocatable, target buffer_dyn
real, dimension(:,:), allocatable uhmax25
character(20), dimension(:), allocatable axis_name_vert
subroutine, public max_vv(is, ie, js, je, npz, ng, up2, dn2, pe, w)
real, parameter missing_value
subroutine, public get_vorticity(isc, iec, jsc, jec, isd, ied, jsd, jed, npz, u, v, vort, dx, dy, rarea)