Skip to content

Commit cf876ee

Browse files
jamiebreschmkavulich
authored andcommitted
Add packaging in registry.var for WRFDA derived type variables #283
TYPE: enhancement KEYWORDS: WRFDA, registry.var, package, derived type SOURCE: Jamie Bresch (NCAR) DESCRIPTION OF CHANGES: A few C programs in tools are modified to allow packaging for derived types that WRFDA use. Main changes are in registry.var. Changes in var/da files are for complementing the registry changes. This reduces the 3DVAR memory usage by another ~15-20%. This PR changes the section of code for ARW's fdob derived type in inc/allocs.inc. But note that fdob is not packaged both before and after the change. LIST OF MODIFIED FILES: M Registry/registry.var M tools/gen_allocs.c M tools/gen_scalar_indices.c M tools/protos.h M var/da/da_main/da_wrfvar_init2.inc M var/da/da_radar/da_radar.f90 M var/da/da_radar/da_transform_xtoy_radar.inc M var/da/da_radar/da_transform_xtoy_radar_adj.inc M var/da/da_radiance/da_crtm.f90 M var/da/da_radiance/da_transform_xtoy_crtm.inc M var/da/da_radiance/da_transform_xtoy_crtm_adj.inc TESTS CONDUCTED: 1. WRFDA regtests on cheyenne with intel/17.0.1 passed. 2. WTF_v03.08 on yellowstone with gnu/4.9.2 and intel/12.1.5 passed. (cherry picked from commit c7405bb)
1 parent fe764d7 commit cf876ee

File tree

11 files changed

+126
-36
lines changed

11 files changed

+126
-36
lines changed

Registry/registry.var

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,3 +839,34 @@ package no_adj_sens adj_sens_used==0 - -
839839
package do_adj_sens adj_sens_used==1 - state:a_u,a_v,a_t,a_mu,a_ph,g_u,g_v,g_t,g_mu,g_ph;a_moist:a_qv;g_moist:g_qv
840840
package no_var4d var4d_used==0 - -
841841
package do_var4d var4d_used==1 - state:a_u,a_v,a_w,a_ph,a_t,a_mu,a_p,a_z,g_u,g_v,g_w,g_ph,g_t,g_mu,g_p,g_z,a_h_diabatic,g_h_diabatic,a_rainc,g_rainc,a_rainnc,g_rainnc,a_raincv,g_raincv,a_rainncv,g_rainncv
842+
843+
rconfig integer cv_w_used derived 1 0 - "cv_w_used" "turn on if use_cv_w=true"
844+
rconfig integer ens_used derived 1 0 - "ens_used" "turn on if ensdim_alpha>0"
845+
rconfig integer cloud_ens_used derived 1 0 - "cloud_ens_used" "turn on if alpha_hydrometeors=true"
846+
rconfig integer var4d_cloudcv derived 1 -1 - "var4d_cloudcv" "turn on if var4d=true and cloud_cv_options>0"
847+
rconfig integer var4d_w_cv derived 1 0 - "var4d_w_cv" "turn on if var4d=true and use_cv_w=true"
848+
rconfig integer wpec_used derived 1 0 - "wpec_used" "turn on if use_wpec=true"
849+
rconfig integer alloc_xa_static derived 1 0 - "alloc_xa_static" "turn on if use_4denvar=true and num_fgat_time>1"
850+
851+
#package derived types
852+
package no_cloud_cv cloud_cv_options==0 - -
853+
package cloud_cv_1 cloud_cv_options==1 - state:xa%qt,xa%qrn,xa%qcw
854+
package cloud_cv_2 cloud_cv_options==2 - state:xa%qrn,xa%qcw,xa%qci,xa%qsn,xa%qgr,vp%v6,vp%v7,vp%v8,vp%v9,vp%v10,vv%v6,vv%v7,vv%v8,vv%v9,vv%v10
855+
package cloud_cv_3 cloud_cv_options==3 - state:xa%qrn,xa%qcw,xa%qci,xa%qsn,xa%qgr,vp%v6,vp%v7,vp%v8,vp%v9,vp%v10,vv%v6,vv%v7,vv%v8,vv%v9,vv%v10
856+
package not_var4d var4d_cloudcv==-1 - -
857+
package no_var4d_ccv var4d_cloudcv==0 - state:vp6%v1,vp6%v2,vp6%v3,vp6%v4,vp6%v5,vv6%v1,vv6%v2,vv6%v3,vv6%v4,vv6%v5,xa%qrn,xa%qcw
858+
package var4d_ccv_1 var4d_cloudcv==1 - state:vp6%v1,vp6%v2,vp6%v3,vp6%v4,vp6%v5,vv6%v1,vv6%v2,vv6%v3,vv6%v4,vv6%v5,x6a%qt,x6a%qrn,x6a%qcw
859+
package var4d_ccv_2 var4d_cloudcv==2 - state:vp6%v1,vp6%v2,vp6%v3,vp6%v4,vp6%v5,vv6%v1,vv6%v2,vv6%v3,vv6%v4,vv6%v5,vp6%v6,vp6%v7,vp6%v8,vp6%v9,vp6%v10,vv6%v6,vv6%v7,vv6%v8,vv6%v9,vv6%v10,x6a%qrn,x6a%qcw,x6a%qci,x6a%qsn,x6a%qgr
860+
package var4d_ccv_3 var4d_cloudcv==3 - state:vp6%v1,vp6%v2,vp6%v3,vp6%v4,vp6%v5,vv6%v1,vv6%v2,vv6%v3,vv6%v4,vv6%v5,vp6%v6,vp6%v7,vp6%v8,vp6%v9,vp6%v10,vv6%v6,vv6%v7,vv6%v8,vv6%v9,vv6%v10,x6a%qrn,x6a%qcw,x6a%qci,x6a%qsn,x6a%qgr
861+
package no_cv_w cv_w_used==0 - -
862+
package has_cv_w cv_w_used==1 - state:vp%v11,vv%v11
863+
package no_var4d_cv_w var4d_w_cv==0 - -
864+
package has_var4d_cv_w var4d_w_cv==1 - state:vp6%v11,vv6%v11
865+
package no_ens ens_used==0 - -
866+
package has_ens ens_used==1 - state:xa_ens%u,xa_ens%v,xa_ens%t,xa_ens%q,xa_ens%psfc,ep%v1,ep%v2,ep%v3,ep%v4,ep%v5,vp%alpha,vv%alpha
867+
package no_ens_cloud cloud_ens_used==0 - -
868+
package has_ens_cloud cloud_ens_used==1 - state:xa_ens%qrn,xa_ens%qcw,xa_ens%qci,xa_ens%qsn,xa_ens%qgr,ep%cw,ep%rn,ep%ci,ep%sn,ep%gr
869+
package no_wpec wpec_used==0 - -
870+
package has_wpec wpec_used==1 - state:xa%grad_p_x,xa%grad_p_y,xa%geoh,xa%mu,xb%xb_p_x,xb%xb_p_y
871+
package no_xa_static alloc_xa_static==0 - -
872+
package has_xa_static alloc_xa_static==1 - state:xa_static%psfc,xa_static%mu,xa_static%u,xa_static%v,xa_static%t,xa_static%q,xa_static%w,xa_static%p,xa_static%geoh,xa_static%rh,xa_static%rho,xa_static%wh,xa_static%ref,xa_static%tgrn,xa_static%u10,xa_static%v10,xa_static%t2,xa_static%q2,xa_static%ztd,xa_static%tpw,xa_static%speed,xa_static%tb19v,xa_static%tb19h,xa_static%tb22v,xa_static%tb37v,xa_static%tb37h,xa_static%tb85v,xa_static%tb85h,xa_static%qt,xa_static%qrn,xa_static%qcw,xa_static%qci,xa_static%qsn,xa_static%qgr

tools/gen_allocs.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ gen_alloc1 ( char * dirname )
4444
get_count_for_alloc( &Domain, &numguys , stats) ; /* howmany deez guys? */
4545
fprintf(stderr,"Registry INFO variable counts: 0d %d 1d %d 2d %d 3d %d\n",stats[0],stats[1],stats[2],stats[3]) ;
4646
fprintf(fp,"#if 1\n") ;
47-
gen_alloc2( fp , "grid%", &Domain, &startpiece , &iguy, &fraction, numguys, FRAC, 1 ) ;
47+
gen_alloc2( fp , "grid%", NULL, &Domain, &startpiece , &iguy, &fraction, numguys, FRAC, 1 ) ;
4848
fprintf(fp,"#endif\n") ;
4949
close_the_file( fp ) ;
5050
return(0) ;
@@ -77,13 +77,14 @@ int
7777
nolistthese( char * ) ;
7878

7979
int
80-
gen_alloc2 ( FILE * fp , char * structname , node_t * node, int *j, int *iguy, int *fraction, int numguys, int frac, int sw ) /* 1 = allocate, 2 = just count */
80+
gen_alloc2 ( FILE * fp , char * structname , char * structname2 , node_t * node, int *j, int *iguy, int *fraction, int numguys, int frac, int sw ) /* 1 = allocate, 2 = just count */
8181
{
8282
node_t * p ;
8383
int tag ;
8484
char post[NAMELEN], post_for_count[NAMELEN] ;
8585
char fname[NAMELEN], dname[NAMELEN], dname_tmp[NAMELEN] ;
8686
char x[NAMELEN] ;
87+
char x2[NAMELEN], fname2[NAMELEN] ;
8788
char dimname[3][NAMELEN] ;
8889
char tchar ;
8990
unsigned int *io_mask ;
@@ -217,10 +218,15 @@ if ( tag == 1 )
217218
} else {
218219
strcpy(fname,field_name(t4,p,(p->ntl>1)?tag:0)) ;
219220
}
221+
if ( structname2 != NULL ) {
222+
sprintf(fname2,"%s%s",structname2,fname) ;
223+
} else {
224+
strcpy(fname2,fname) ;
225+
}
220226

221227
/* check for errors in memory allocation */
222228

223-
if ( ! p->boundary_array ) { fprintf(fp,"IF(okay_to_alloc.AND.in_use_for_config(id,'%s')",fname) ; }
229+
if ( ! p->boundary_array ) { fprintf(fp,"IF(okay_to_alloc.AND.in_use_for_config(id,'%s')",fname2) ; }
224230
else { fprintf(fp,"IF(.TRUE.") ; }
225231

226232
if ( ! ( p->node_kind & FOURD ) && sw == 1 &&
@@ -475,7 +481,8 @@ if ( tag == 1 )
475481
if ( p->type->type_type == DERIVED )
476482
{
477483
sprintf(x,"%s%s%%",structname,p->name ) ;
478-
gen_alloc2(fp,x, p->type, j, iguy, fraction, numguys, 1, sw) ;
484+
sprintf(x2,"%s%%",p->name ) ;
485+
gen_alloc2(fp,x, x2, p->type, j, iguy, fraction, numguys, 1, sw) ;
479486
}
480487
}
481488
} /* fraction loop */
@@ -502,7 +509,7 @@ gen_alloc_count1 ( char * dirname )
502509
else { sprintf(fname,"%s",fn) ; }
503510
if ((fp = fopen( fname , "w" )) == NULL ) return(1) ;
504511
print_warning(fp,fname) ;
505-
gen_alloc2( fp , "grid%", &Domain, 0 ) ;
512+
gen_alloc2( fp , "grid%", NULL, &Domain, 0 ) ;
506513
close_the_file( fp ) ;
507514
return(0) ;
508515
}

tools/gen_scalar_indices.c

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "registry.h"
1313
#include "data.h"
1414

15+
#define NULLCHARPTR (char *) 0
1516

1617
int
1718
gen_scalar_indices ( char * dirname )
@@ -116,6 +117,7 @@ gen_scalar_indices1 ( FILE * fp, FILE ** fp2 )
116117
node_t * p, * memb , * pkg, * rconfig, * fourd, *x ;
117118
char * c , *pos1, *pos2 ;
118119
char assoc_namelist_var[NAMELEN], assoc_namelist_choice[NAMELEN], assoc_4d[NAMELEN_LONG], fname[NAMELEN_LONG] ;
120+
char fname2[NAMELEN], tmp1[NAMELEN], tmp2[NAMELEN] ;
119121
char scalars_str[NAMELEN_LONG] ;
120122
char * scalars ;
121123
int i ;
@@ -151,7 +153,7 @@ gen_scalar_indices1 ( FILE * fp, FILE ** fp2 )
151153
if ( (fourd=get_4d_entry( assoc_4d )) != NULL || !strcmp( assoc_4d, "state" ) ) {
152154
for ( c = strtok_rentr(NULL,",",&pos2) ; c != NULL ; c = strtok_rentr(NULL,",",&pos2) )
153155
{
154-
if ( fourd != NULL && ( ( x = get_entry( c , fourd->members )) != NULL ) ) {
156+
if ( fourd != NULL && ( ( x = get_entry_r( c , NULL, fourd->members )) != NULL ) ) {
155157
fprintf(fp," IF ( %s_index_table( PARAM_%s , idomain ) .lt. 1 ) THEN\n",assoc_4d,c) ;
156158
fprintf(fp," %s_num_table(idomain) = %s_num_table(idomain) + 1\n",assoc_4d,assoc_4d) ;
157159
fprintf(fp," P_%s = %s_num_table(idomain)\n",c,assoc_4d) ;
@@ -165,7 +167,7 @@ gen_scalar_indices1 ( FILE * fp, FILE ** fp2 )
165167
/* set io_mask accordingly for gen_wrf_io to know that it should generate i/o for _b and _bt */
166168
/* arrays */
167169
sprintf(fourd_bnd,"%s_b",assoc_4d) ;
168-
if ( get_entry( fourd_bnd ,Domain.fields) != NULL ) {
170+
if ( get_entry_r( fourd_bnd, NULL, Domain.fields) != NULL ) {
169171
x->boundary = 1 ;
170172
}
171173
}
@@ -181,7 +183,7 @@ gen_scalar_indices1 ( FILE * fp, FILE ** fp2 )
181183
}
182184

183185
fprintf(fp," F_%s = .TRUE.\n",c) ;
184-
} else if ((p = get_entry( c , Domain.fields )) != NULL ) {
186+
} else if ((p = get_entry_r( c , NULL, Domain.fields )) != NULL ) {
185187
int tag, fo ;
186188
for ( tag = 1 ; tag <= p->ntl ; tag++ )
187189
{
@@ -190,11 +192,25 @@ gen_scalar_indices1 ( FILE * fp, FILE ** fp2 )
190192
} else {
191193
strcpy(fname,field_name(t4,p,(p->ntl>1)?tag:0)) ;
192194
}
193-
make_lower_case(fname) ;
195+
if ( strchr (c, '%') != NULLCHARPTR ) {
196+
strcpy(fname2,c) ;
197+
} else {
198+
sprintf(tmp1,"%s_tend",p->name) ;
199+
sprintf(tmp2,"%s_old",p->name) ;
200+
if ( !strcmp(c, tmp1) ) {
201+
strcpy(fname2,tmp1) ;
202+
} else if ( !strcmp(c, tmp2) ) {
203+
strcpy(fname2,tmp2) ;
204+
} else {
205+
strcpy(fname2,fname) ;
206+
}
207+
}
208+
209+
make_lower_case(fname2) ;
194210

195-
fo = fname[0]-'a' ;
211+
fo = fname2[0]-'a' ;
196212

197-
fprintf(fp2[fo],"IF(TRIM(vname).EQ.'%s')THEN\n",fname) ;
213+
fprintf(fp2[fo],"IF(TRIM(vname).EQ.'%s')THEN\n",fname2) ;
198214
fprintf(fp2[fo]," IF(uses.EQ.0)THEN\n");
199215
fprintf(fp2[fo]," in_use = model_config_rec%%%s%s.EQ.%s\n",assoc_namelist_var,(atoi(rconfig->nentries)!=1)?"(id)":"",assoc_namelist_choice) ;
200216
fprintf(fp2[fo]," uses = 1\n") ;

tools/protos.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ char * get_typename_i(int i) ;
6767

6868
int gen_alloc ( char * dirname ) ;
6969
int gen_alloc1 ( char * dirname ) ;
70-
int gen_alloc2 ( FILE * fp , char * structname , node_t * node, int *j, int *iguy, int *fraction, int numguys, int frac, int sw );
70+
int gen_alloc2 ( FILE * fp , char * structname , char * structname2 , node_t * node, int *j, int *iguy, int *fraction, int numguys, int frac, int sw );
7171

7272
int gen_module_state_description ( char * dirname ) ;
7373
int gen_module_state_description1 ( FILE * fp , node_t * node ) ;

var/da/da_main/da_wrfvar_init2.inc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,26 @@ subroutine da_wrfvar_init2
106106
model_config_rec%adj_sens_used = 1
107107
end if
108108

109+
if ( var4d ) then
110+
model_config_rec%var4d_cloudcv = cloud_cv_options
111+
if ( use_cv_w ) model_config_rec%var4d_w_cv = 1
112+
end if
113+
if ( use_cv_w ) then
114+
model_config_rec%cv_w_used = 1
115+
end if
116+
if ( ensdim_alpha > 0 ) then
117+
model_config_rec%ens_used = 1
118+
end if
119+
if ( alpha_hydrometeors ) then
120+
model_config_rec%cloud_ens_used = 1
121+
end if
122+
if ( use_wpec ) then
123+
model_config_rec%wpec_used = 1
124+
end if
125+
if ( use_4denvar .and. num_fgat_time > 1 ) then
126+
model_config_rec%alloc_xa_static = 1
127+
end if
128+
109129
!<DESCRIPTION>
110130
! Among the configuration variables read from the namelist is
111131
! debug_level. This is retrieved using nl_get_debug_level (Registry

var/da/da_radar/da_radar.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module da_radar
1818
use da_control, only : cloudbase_calc_opt, &
1919
radar_non_precip_rf, radar_non_precip_opt, radar_rqv_thresh1, radar_rqv_thresh2, &
2020
radar_rqv_rh1, radar_rqv_rh2, radar_non_precip_rh_w, radar_non_precip_rh_i, &
21-
radar_rqv_h_lbound, radar_rqv_h_ubound, radar_saturated_rf
21+
radar_rqv_h_lbound, radar_rqv_h_ubound, radar_saturated_rf, cloud_cv_options
2222
use da_define_structures, only : maxmin_type, iv_type, y_type, jo_type, &
2323
bad_data_type, x_type, number_type, bad_data_type, &
2424
infa_type, field_type

var/da/da_radar/da_transform_xtoy_radar.inc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,17 @@ subroutine da_transform_xtoy_radar (grid, iv, y)
6969
call da_interp_lin_3d (grid%xa%u, iv%info(radar), model_u)
7070
call da_interp_lin_3d (grid%xa%v, iv%info(radar), model_v)
7171
#endif
72-
call da_interp_lin_3d (grid%xa%qrn, iv%info(radar), model_qrn)
7372
call da_interp_lin_3d (grid%xa%wh, iv%info(radar), model_w)
74-
call da_interp_lin_3d (grid%xa%qsn, iv%info(radar), model_qsn)
75-
call da_interp_lin_3d (grid%xa%qgr, iv%info(radar), model_qgr)
73+
model_qsn = 0.0
74+
model_qgr = 0.0
75+
model_qrn = 0.0
76+
if ( cloud_cv_options >= 1 ) then
77+
call da_interp_lin_3d (grid%xa%qrn, iv%info(radar), model_qrn)
78+
if ( cloud_cv_options >= 2 ) then
79+
call da_interp_lin_3d (grid%xa%qsn, iv%info(radar), model_qsn)
80+
call da_interp_lin_3d (grid%xa%qgr, iv%info(radar), model_qgr)
81+
end if
82+
end if
7683
call da_interp_lin_3d (grid%xa%q, iv%info(radar), model_qv)
7784
call da_interp_lin_3d (grid%xa%t, iv%info(radar), model_t)
7885
!basic states

var/da/da_radar/da_transform_xtoy_radar_adj.inc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,13 @@ subroutine da_transform_xtoy_radar_adj(grid, iv, jo_grad_y, jo_grad_x)
142142
! [1.6] Interpolate horizontally from crs points:
143143

144144
call da_interp_lin_3d_adj (jo_grad_x % wh, iv%info(radar), model_w)
145-
call da_interp_lin_3d_adj (jo_grad_x % qrn, iv%info(radar), model_qrn)
146-
call da_interp_lin_3d_adj (jo_grad_x % qsn, iv%info(radar), model_qsn)
147-
call da_interp_lin_3d_adj (jo_grad_x % qgr, iv%info(radar), model_qgr)
145+
if ( cloud_cv_options >= 1 ) then
146+
call da_interp_lin_3d_adj (jo_grad_x % qrn, iv%info(radar), model_qrn)
147+
if ( cloud_cv_options >= 2 ) then
148+
call da_interp_lin_3d_adj (jo_grad_x % qsn, iv%info(radar), model_qsn)
149+
call da_interp_lin_3d_adj (jo_grad_x % qgr, iv%info(radar), model_qgr)
150+
end if
151+
end if
148152
call da_interp_lin_3d_adj (jo_grad_x % q, iv%info(radar), model_qv)
149153
call da_interp_lin_3d_adj (jo_grad_x % t, iv%info(radar), model_t)
150154
#ifdef A2C

var/da/da_radiance/da_crtm.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ module da_crtm
3737
use_antcorr, time_slots, use_satcv, use_simulated_rad, simulated_rad_io, &
3838
simulated_rad_ngrid, interp_option, use_mspps_emis, use_mspps_ts, calc_weightfunc, &
3939
use_clddet_ecmwf,its,ite,jts,jte, &
40-
crtm_coef_path, crtm_irwater_coef, crtm_mwwater_coef, crtm_irland_coef, crtm_visland_coef
40+
crtm_coef_path, crtm_irwater_coef, crtm_mwwater_coef, crtm_irland_coef, crtm_visland_coef, &
41+
cloud_cv_options
4142
use da_interpolation, only : da_interp_lin_2d_partial,da_interp_lin_2d_adj_partial, &
4243
da_interp_2d_partial
4344
use module_dm, only : wrf_dm_sum_real, wrf_dm_sum_reals

var/da/da_radiance/da_transform_xtoy_crtm.inc

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,20 @@ subroutine da_transform_xtoy_crtm (cv_size, cv, grid, iv, y )
243243
call da_interp_2d_partial (grid%xa%q(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
244244
absorber(kte-k+1,:))
245245

246-
if (crtm_cloud) then
247-
248-
call da_interp_2d_partial (grid%xa%qcw(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
249-
qcw(kte-k+1,:))
250-
call da_interp_2d_partial (grid%xa%qci(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
251-
qci(kte-k+1,:))
252-
call da_interp_2d_partial (grid%xa%qrn(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
253-
qrn(kte-k+1,:))
254-
call da_interp_2d_partial (grid%xa%qsn(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
255-
qsn(kte-k+1,:))
256-
call da_interp_2d_partial (grid%xa%qgr(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
257-
qgr(kte-k+1,:))
246+
if ( crtm_cloud .and. cloud_cv_options > 0 ) then
247+
248+
call da_interp_2d_partial (grid%xa%qcw(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
249+
qcw(kte-k+1,:))
250+
call da_interp_2d_partial (grid%xa%qrn(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
251+
qrn(kte-k+1,:))
252+
if ( cloud_cv_options > 1 ) then
253+
call da_interp_2d_partial (grid%xa%qci(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
254+
qci(kte-k+1,:))
255+
call da_interp_2d_partial (grid%xa%qsn(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
256+
qsn(kte-k+1,:))
257+
call da_interp_2d_partial (grid%xa%qgr(:,:,k), iv%instid(inst)%info, k, iv%instid(inst)%info%n1, iv%instid(inst)%info%n2, &
258+
qgr(kte-k+1,:))
259+
end if
258260

259261
end if
260262

0 commit comments

Comments
 (0)