Skip to content

Commit 346e8cf

Browse files
authored
Change default t_printensemble to disable debug output (#42)
Previously, `t_printensemble` defaulted to `-1`, which triggered debug output at every DA time step. The debug condition checked for any negative value (`< 0`), making debug output enabled by default. This commit changes the default of `t_printensemble` to `-2` (no debug output) and updates the condition to explicitly check for -1. Debug output must now be explicitly enabled by setting `t_printensemble=-1` in `enkfpf.par`. Commit message checked after generation with [Claude Code](https://claude.com/claude-code)
1 parent 3c9cef3 commit 346e8cf

5 files changed

Lines changed: 22 additions & 18 deletions

File tree

docs/users_guide/running_tsmp_pdaf/input_enkfpf.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,11 @@ containing the pre-DA state ensemble is `integrate`.
357357
`PF:t_printensemble`: (integer) The timestep for the state ensemble
358358
output switched on under `PF:printensemble`.
359359

360-
Default setting is `-1`, which means: Print debug output at every DA
360+
Another setting is `-1`, which means: Print debug output at every DA
361361
time step.
362362

363+
Default setting is `-2`, which means: No additional debug output.
364+
363365
### PF:printstat ###
364366

365367
`PF:printstat`: (integer) If set to `1` (default) the ensemble
@@ -568,9 +570,11 @@ Layers](https://escomp.github.io/ctsm-docs/versions/master/html/tech_note/Ecosys
568570
`CLM:t_printensemble`: (integer) The timestep for the state ensemble
569571
output switched on with the debug flag `PDAF_DEBUG`.
570572

571-
Default setting is `-1`, which means: Print debug output at every DA
573+
Another setting is `-1`, which means: Print debug output at every DA
572574
time step.
573575

576+
Default setting is `-2`, which means: No additional debug output.
577+
574578
### CLM:watmin_switch ###
575579

576580
`CLM:watmin_switch`: (integer) Switch for the values of minimal soil
@@ -877,7 +881,7 @@ Default: 0, output turned off.
877881
| | `aniso_use_parflow` | 0 |
878882
| | | |
879883
| | `printensemble` | 1 |
880-
| | `t_printensemble` | -1 |
884+
| | `t_printensemble` | -2 |
881885
| | `printstat` | 1 |
882886
| | `paramprintensemble` | 1 |
883887
| | `paramprintstat` | 1 |
@@ -894,7 +898,7 @@ Default: 0, output turned off.
894898
| | `statevec_colmean` | 0 |
895899
| | `statevec_only_active` | 0 |
896900
| | `statevec_max_layer` | 25 |
897-
| | `t_printensemble` | -1 |
901+
| | `t_printensemble` | -2 |
898902
| | `watmin_switch` | 0 |
899903
| `[COSMO]` | | |
900904
| | `nprocs` | 0 |

interface/model/clm3_5/enkf_clm_mod.F90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ subroutine set_clm_statevec(tstartcycle, mype)
206206
ttlai => clm3%g%l%c%p%pps%tlai !hcp
207207

208208
#ifdef PDAF_DEBUG
209-
IF(clmt_printensemble == tstartcycle + 1 .OR. clmt_printensemble < 0) THEN
209+
IF(clmt_printensemble == tstartcycle + 1 .OR. clmt_printensemble == -1) THEN
210210

211211
IF(clmupdate_swc.NE.0) THEN
212212
! TSMP-PDAF: Debug output of CLM swc
@@ -290,7 +290,7 @@ subroutine set_clm_statevec(tstartcycle, mype)
290290
endif
291291

292292
#ifdef PDAF_DEBUG
293-
IF(clmt_printensemble == tstartcycle + 1 .OR. clmt_printensemble < 0) THEN
293+
IF(clmt_printensemble == tstartcycle + 1 .OR. clmt_printensemble == -1) THEN
294294
! TSMP-PDAF: For debug runs, output the state vector in files
295295
WRITE(fn, "(a,i5.5,a,i5.5,a)") "clmstate_", mype, ".integrate.", tstartcycle + 1, ".txt"
296296
OPEN(unit=71, file=fn, action="write")
@@ -341,7 +341,7 @@ subroutine update_clm(tstartcycle, mype) bind(C,name="update_clm")
341341
logical :: swc_zero_before_update = .false.
342342

343343
#ifdef PDAF_DEBUG
344-
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble < 0) THEN
344+
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble == -1) THEN
345345
! TSMP-PDAF: For debug runs, output the state vector in files
346346
WRITE(fn, "(a,i5.5,a,i5.5,a)") "clmstate_", mype, ".update.", tstartcycle, ".txt"
347347
OPEN(unit=71, file=fn, action="write")
@@ -364,7 +364,7 @@ subroutine update_clm(tstartcycle, mype) bind(C,name="update_clm")
364364
h2osoi_ice => clm3%g%l%c%cws%h2osoi_ice
365365

366366
#ifdef PDAF_DEBUG
367-
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble < 0) THEN
367+
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble == -1) THEN
368368

369369
IF(clmupdate_swc.NE.0) THEN
370370
! TSMP-PDAF: For debug runs, output the state vector in files
@@ -476,7 +476,7 @@ subroutine update_clm(tstartcycle, mype) bind(C,name="update_clm")
476476
end do
477477

478478
#ifdef PDAF_DEBUG
479-
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble < 0) THEN
479+
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble == -1) THEN
480480

481481
IF(clmupdate_swc.NE.0) THEN
482482
! TSMP-PDAF: For debug runs, output the state vector in files

interface/model/common/read_enkfpar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void read_enkfpar(char *parname)
5353
pf_aniso_perm_z = iniparser_getdouble(pardict,"PF:aniso_perm_z",1);
5454
pf_aniso_use_parflow = iniparser_getint(pardict,"PF:aniso_use_parflow",0);
5555
pf_printensemble = iniparser_getint(pardict,"PF:printensemble",1);
56-
pf_t_printensemble = iniparser_getint(pardict,"PF:t_printensemble",-1);
56+
pf_t_printensemble = iniparser_getint(pardict,"PF:t_printensemble",-2);
5757
pf_printstat = iniparser_getint(pardict,"PF:printstat",1);
5858
pf_paramprintensemble = iniparser_getint(pardict,"PF:paramprintensemble",1);
5959
pf_paramprintstat = iniparser_getint(pardict,"PF:paramprintstat",1);
@@ -85,7 +85,7 @@ void read_enkfpar(char *parname)
8585
clmstatevec_colmean = iniparser_getint(pardict,"CLM:statevec_colmean",0);
8686
clmstatevec_only_active = iniparser_getint(pardict,"CLM:statevec_only_active",0);
8787
clmstatevec_max_layer = iniparser_getint(pardict,"CLM:statevec_max_layer",25);
88-
clmt_printensemble = iniparser_getint(pardict,"CLM:t_printensemble",-1);
88+
clmt_printensemble = iniparser_getint(pardict,"CLM:t_printensemble",-2);
8989
clmwatmin_switch = iniparser_getint(pardict,"CLM:watmin_switch",0);
9090
clmswc_mask_snow = iniparser_getint(pardict,"CLM:swc_mask_snow",0);
9191

interface/model/eclm/enkf_clm_mod_5.F90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ subroutine set_clm_statevec(tstartcycle, mype)
408408
porgm => soilstate_inst%cellorg_col
409409

410410
#ifdef PDAF_DEBUG
411-
IF(clmt_printensemble == tstartcycle + 1 .OR. clmt_printensemble < 0) THEN
411+
IF(clmt_printensemble == tstartcycle + 1 .OR. clmt_printensemble == -1) THEN
412412

413413
IF(clmupdate_swc/=0) THEN
414414
! TSMP-PDAF: Debug output of CLM swc
@@ -458,7 +458,7 @@ subroutine set_clm_statevec(tstartcycle, mype)
458458
endif
459459

460460
#ifdef PDAF_DEBUG
461-
IF(clmt_printensemble == tstartcycle + 1 .OR. clmt_printensemble < 0) THEN
461+
IF(clmt_printensemble == tstartcycle + 1 .OR. clmt_printensemble == -1) THEN
462462
! TSMP-PDAF: For debug runs, output the state vector in files
463463
WRITE(fn, "(a,i5.5,a,i5.5,a)") "clmstate_", mype, ".integrate.", tstartcycle + 1, ".txt"
464464
OPEN(unit=71, file=fn, action="write")
@@ -560,7 +560,7 @@ subroutine update_clm(tstartcycle, mype) bind(C,name="update_clm")
560560
swc_zero_before_update = .false.
561561

562562
#ifdef PDAF_DEBUG
563-
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble < 0) THEN
563+
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble == -1) THEN
564564
! TSMP-PDAF: For debug runs, output the state vector in files
565565
WRITE(fn, "(a,i5.5,a,i5.5,a)") "clmstate_", mype, ".update.", tstartcycle, ".txt"
566566
OPEN(unit=71, file=fn, action="write")
@@ -575,7 +575,7 @@ subroutine update_clm(tstartcycle, mype) bind(C,name="update_clm")
575575
h2osoi_ice => waterstate_inst%h2osoi_ice_col
576576

577577
#ifdef PDAF_DEBUG
578-
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble < 0) THEN
578+
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble == -1) THEN
579579

580580
IF(clmupdate_swc/=0) THEN
581581
! TSMP-PDAF: For debug runs, output the state vector in files
@@ -774,7 +774,7 @@ subroutine update_clm_swc(tstartcycle, mype)
774774
end do
775775

776776
#ifdef PDAF_DEBUG
777-
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble < 0) THEN
777+
IF(clmt_printensemble == tstartcycle .OR. clmt_printensemble == -1) THEN
778778

779779
! TSMP-PDAF: For debug runs, output the state vector in files
780780
WRITE(fn3, "(a,i5.5,a,i5.5,a)") "h2osoi_liq", mype, ".update.", tstartcycle, ".txt"

interface/model/parflow/enkf_parflow.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ void enkfparflowadvance(int tcycle, double current_time, double dt)
625625
added to `tstartcycle` in the wrapper subroutine directly
626626
after this routine, so the added value fits better than
627627
the current value. */
628-
if(pf_t_printensemble == tstartcycle + 1 || pf_t_printensemble < 0 ) {
628+
if(pf_t_printensemble == tstartcycle + 1 || pf_t_printensemble == -1 ) {
629629
if(pf_printensemble == 1) {
630630
enkf_printstatistics_pfb(&pf_statevec[0],"integrate",tstartcycle + 1 + stat_dumpoffset,pfoutfile_ens,3);
631631
}
@@ -1485,7 +1485,7 @@ void update_parflow () {
14851485
}
14861486

14871487
/* print updated ensemble */
1488-
if(pf_t_printensemble == tstartcycle || pf_t_printensemble < 0 ) {
1488+
if(pf_t_printensemble == tstartcycle || pf_t_printensemble == -1 ) {
14891489
if(pf_updateflag == 3){
14901490
if(pf_printensemble == 1) enkf_printstatistics_pfb(&pf_statevec[enkf_subvecsize],"update",tstartcycle + stat_dumpoffset,pfoutfile_ens,3);
14911491
}else{

0 commit comments

Comments
 (0)