Skip to content

Commit

Permalink
Add handling to calculate analysis and interplate increments for numb…
Browse files Browse the repository at this point in the history
…er (#46)

concentration of ice and rain (thompson scheme)

Co-authored-by: Cory Martin <[email protected]>
  • Loading branch information
emilyhcliu and CoryMartin-NOAA authored Aug 13, 2024
1 parent 4d4daa2 commit 71ae183
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
18 changes: 11 additions & 7 deletions src/netcdf_io/calc_analysis.fd/inc2anl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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 '/
Expand Down
16 changes: 13 additions & 3 deletions src/netcdf_io/interp_inc.fd/driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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) )

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 71ae183

Please sign in to comment.