From 71ae183f33e5451c5424f34664660c218e292bb4 Mon Sep 17 00:00:00 2001 From: emilyhcliu <36091766+emilyhcliu@users.noreply.github.com> Date: Tue, 13 Aug 2024 08:33:58 -0400 Subject: [PATCH] Add handling to calculate analysis and interplate increments for number (#46) concentration of ice and rain (thompson scheme) Co-authored-by: Cory Martin --- src/netcdf_io/calc_analysis.fd/inc2anl.f90 | 18 +++++++++++------- src/netcdf_io/interp_inc.fd/driver.F90 | 16 +++++++++++++--- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/netcdf_io/calc_analysis.fd/inc2anl.f90 b/src/netcdf_io/calc_analysis.fd/inc2anl.f90 index 246147a2..512bf48e 100644 --- a/src/netcdf_io/calc_analysis.fd/inc2anl.f90 +++ b/src/netcdf_io/calc_analysis.fd/inc2anl.f90 @@ -15,24 +15,28 @@ module inc2anl public :: gen_anl, close_files - integer, parameter :: nincv=10 + integer, parameter :: nincv=13 character(len=7) :: incvars_nemsio(nincv), incvars_netcdf(nincv), incvars_ncio(nincv) - integer, parameter :: nnciov=20 + integer, parameter :: nnciov=22 integer, parameter :: naero=14 integer, parameter :: naero_copy=6 character(len=7) :: iovars_netcdf(nnciov), iovars_aero(naero), copyvars_aero(naero_copy) character(len=50) :: incvars_aero(naero) data incvars_nemsio / 'ugrd ', 'vgrd ', 'dpres ', 'delz ', 'o3mr ',& - 'tmp ', 'spfh ', 'clwmr ', 'icmr ', 'pres '/ + 'tmp ', 'spfh ', 'clwmr ', 'icmr ', 'rwmr ',& + 'snmr ', 'grle ', 'pres '/ data incvars_netcdf / 'u ', 'v ', 'delp ', 'delz ', 'o3mr ',& - 'T ', 'sphum ', 'liq_wat', 'icmr ', 'pres '/ - data incvars_ncio / 'ugrd ', 'vgrd ', 'dpres ', 'delz ', 'o3mr ',& - 'tmp ', 'spfh ', 'clwmr ', 'icmr ', 'pressfc'/ + 'T ', 'sphum ', 'liq_wat', 'icmr ', 'rwmr ',& + 'snmr ', 'grle ', 'pres '/ + data incvars_ncio / 'ugrd ', 'vgrd ', 'dpres ', 'delz ', 'o3mr ',& + 'tmp ', 'spfh ', 'clwmr ', 'icmr ', 'rwmr ',& + 'snmr ', 'grle ', 'pressfc'/ data iovars_netcdf / 'grid_xt', 'grid_yt', 'pfull ', 'phalf ', 'clwmr ',& 'delz ', 'dpres ', 'dzdt ', 'grle ', 'hgtsfc ',& 'icmr ', 'o3mr ', 'pressfc', 'rwmr ', 'snmr ',& - 'spfh ', 'tmp ', 'ugrd ', 'vgrd ', 'cld_amt'/ + 'spfh ', 'tmp ', 'ugrd ', 'vgrd ', 'cld_amt',& + 'nccice ', 'nconrd '/ data iovars_aero / 'so4 ', 'bc1 ', 'bc2 ', 'oc1 ', 'oc2 ', & 'dust1 ', 'dust2 ', 'dust3 ', 'dust4 ', 'dust5 ',& 'seas1 ', 'seas2 ', 'seas3 ', 'seas4 '/ diff --git a/src/netcdf_io/interp_inc.fd/driver.F90 b/src/netcdf_io/interp_inc.fd/driver.F90 index 722b5dde..d01a5d13 100644 --- a/src/netcdf_io/interp_inc.fd/driver.F90 +++ b/src/netcdf_io/interp_inc.fd/driver.F90 @@ -30,7 +30,7 @@ program interp_inc implicit none - integer, parameter :: num_recs = 9 + integer, parameter :: num_recs = 12 ! Declare externals external :: w3tagb, netcdf_err, splat, w3tage @@ -57,6 +57,7 @@ program interp_inc integer :: id_t_inc_out, id_sphum_inc_out integer :: id_liq_wat_inc_out, id_o3mr_inc_out integer :: id_icmr_inc_out, id_dim + integer :: id_rwmr_inc_out, id_snmr_inc_out, id_grle_inc_out integer :: header_buffer_val = 16384 integer :: kgds_in(200), kgds_out(200) integer :: ip, ipopt(20), no @@ -79,7 +80,8 @@ program interp_inc ! NOTE: u_inc,v_inc must be consecutive data records /'u_inc', 'v_inc', 'delp_inc', 'delz_inc', 'T_inc', & - 'sphum_inc', 'liq_wat_inc', 'o3mr_inc', 'icmr_inc' / + 'sphum_inc', 'liq_wat_inc', 'o3mr_inc', 'icmr_inc', & + 'rwmr_inc', 'snmr_inc', 'grle_inc' / namelist /setup/ lon_out, lat_out, outfile, infile, lev @@ -187,7 +189,16 @@ program interp_inc error = nf90_def_var(ncid_out, 'icmr_inc', nf90_float, (/dim_lon_out,dim_lat_out,dim_lev_out/), id_icmr_inc_out) call netcdf_err(error, 'defining variable icmr_inc for file='//trim(outfile) ) + + error = nf90_def_var(ncid_out, 'rwmr_inc', nf90_float, (/dim_lon_out,dim_lat_out,dim_lev_out/), id_rwmr_inc_out) + call netcdf_err(error, 'defining variable rwmr_inc for file='//trim(outfile) ) + error = nf90_def_var(ncid_out, 'snmr_inc', nf90_float, (/dim_lon_out,dim_lat_out,dim_lev_out/), id_snmr_inc_out) + call netcdf_err(error, 'defining variable snmr_inc for file='//trim(outfile) ) + + error = nf90_def_var(ncid_out, 'grle_inc', nf90_float, (/dim_lon_out,dim_lat_out,dim_lev_out/), id_grle_inc_out) + call netcdf_err(error, 'defining variable grle_inc for file='//trim(outfile) ) + error = nf90_put_att(ncid_out, nf90_global, 'source', 'GSI') call netcdf_err(error, 'defining source attribute for file='//trim(outfile) ) @@ -355,7 +366,6 @@ program interp_inc error = nf90_get_var(ncid_in, id_var, dummy_in) call netcdf_err(error, 'reading ' // trim(records(rec)) // ' for file='//trim(infile) ) - ip = 0 ! bilinear ipopt = 0 ibi = 0