-
Notifications
You must be signed in to change notification settings - Fork 5
Tsmp pdaf patched lstda cap #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c49edbe
0fb734a
b186564
35c9c93
929471f
0f3738b
53998fb
75ac19f
34a47ca
43d1ba3
3df6fd0
9e88c2a
ff0373a
4bd276d
75eb0ec
d41c6b2
0778801
6d8babe
fb67c10
75f2b8d
2b7f957
6a6706a
90cefc6
9936414
9625bee
319bd8c
35b1dc0
58501ab
3847db7
ee6cc3e
7174f1b
5c307e5
d1cb4d3
afc7202
95a0e5f
f9e886b
747dee9
58025fa
38ffe0e
2a5657f
e67133a
8eee110
249c4ad
1203bae
b3d0415
78266fc
43916e8
eb2f6bd
cc24bd1
3cb7dbe
aebde39
9eaf7f5
7a39038
9b58f24
b1f7664
5583f0e
e6dcd08
bde2960
790316b
2b707f9
7d06515
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -63,6 +63,10 @@ statevec_max_layer = | |||||||||||||||||||||
| t_printensemble = | ||||||||||||||||||||||
| watmin_switch = | ||||||||||||||||||||||
| swc_mask_snow = | ||||||||||||||||||||||
| T_mask_snow = | ||||||||||||||||||||||
| increment_type = | ||||||||||||||||||||||
| T_mask_T = | ||||||||||||||||||||||
| T_max_increment = | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| [COSMO] | ||||||||||||||||||||||
| nprocs = | ||||||||||||||||||||||
|
|
@@ -484,12 +488,14 @@ CLM (standalone only). | |||||||||||||||||||||
| `CLM:update_T`: (integer) Flag for updating of ground and vegetation | ||||||||||||||||||||||
| temperature. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Currently only CLM3.5 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - 0: No update of ground and vegetation temperature | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - 1: Update of ground and vegetation temperature | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - 2: Update of soil and vegetation temperature (prognostic variables) | ||||||||||||||||||||||
| based on comparison of satellite LST with skin temperature | ||||||||||||||||||||||
| (diagnostic variable) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### CLM:print_swc ### | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| `CLM:print_swc`: (integer) If set to `1`, the updated soil moisture | ||||||||||||||||||||||
|
|
@@ -601,6 +607,50 @@ Only takes effect if `CLM:update_swc``is switched on. | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| Default setting is `0`: No masking of columns with snow cover. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### CLM:T_mask_snow ### | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| `CLM:T_mask_snow`: (integer) Switch for masking columns with snow | ||||||||||||||||||||||
| cover from T updates. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Snow covers larger than 1mm are switched off for the update. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Only takes effect if `CLM:update_T``is switched on. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Default setting is `0`: No masking of columns with snow cover. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### CLM:increment_type ### | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| `CLM:increment_type`: (integer) Switch for changing increment type in | ||||||||||||||||||||||
| T-update. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - `0`: Multiplicative increment | ||||||||||||||||||||||
| - `1`: Additive increment | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Only takes effect if `CLM:update_T` is switched on. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Default setting is `0`: Multiplicative increment. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### CLM:T_max_increment ### | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| `CLM:T_max_increment`: (double) Maximum T-increment to update | ||||||||||||||||||||||
| (additively). | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Only takes effect if `CLM:update_T` is switched on and | ||||||||||||||||||||||
| `CLM:increment_type` is set to `1`. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Default setting is `5.0`: Updates larger than 5K are not applied. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### CLM:T_mask_T ### | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| `CLM:T_mask_T`: (double) Temperature difference to add to freezing | ||||||||||||||||||||||
| temperature resulting in a threshold temperature for masking out T | ||||||||||||||||||||||
| updates. Whenever the soil temperature of the surface layer falls | ||||||||||||||||||||||
| below this threshold temperature, no T is not updated. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Only takes effect if `CLM:update_T``is switched on. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Default setting is `0.`: Masking updates below freezing temperaturs. | ||||||||||||||||||||||
|
Comment on lines
+648
to
+652
|
||||||||||||||||||||||
| below this threshold temperature, no T is not updated. | |
| Only takes effect if `CLM:update_T``is switched on. | |
| Default setting is `0.`: Masking updates below freezing temperaturs. | |
| below this threshold temperature, no T is updated. | |
| Only takes effect if `CLM:update_T` is switched on. | |
| Default setting is `0.`: Masking updates below freezing temperatures. |
Copilot
AI
Mar 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The defaults table at the end was updated for T_mask_snow/T_mask_T, but it doesn’t list the new increment_type and T_max_increment keys that were added above. Please extend the table so it stays complete/consistent with the documented parameters.
| | | `T_mask_T` | 0.0 | | |
| | | `T_mask_T` | 0.0 | | |
| | | `increment_type` | 0 | | |
| | | `T_max_increment` | 0.0 | |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,6 +129,7 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f) | |
| #ifdef CLMFIVE | ||
| use GridcellType, only: grc | ||
| use ColumnType, only : col | ||
| use PatchType, only : patch | ||
| ! use GetGlobalValuesMod, only: GetGlobalWrite | ||
| ! use clm_varcon, only: nameg | ||
| use enkf_clm_mod, only: state_clm2pdaf_p | ||
|
|
@@ -145,6 +146,8 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f) | |
| USE enkf_clm_mod, only: domain_def_clm | ||
| USE enkf_clm_mod, only: get_interp_idx | ||
| use enkf_clm_mod, only: clmstatevec_allcol | ||
| use enkf_clm_mod, only: clmupdate_swc | ||
| use enkf_clm_mod, only: clmupdate_T | ||
| !hcp end | ||
| #endif | ||
| #endif | ||
|
|
@@ -164,9 +167,11 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f) | |
| integer :: ierror | ||
| INTEGER :: max_var_id ! Multi-scale DA | ||
| INTEGER :: sum_dim_obs_p | ||
| INTEGER :: p ! CLM Patch index | ||
| INTEGER :: c ! CLM Column index | ||
| INTEGER :: g ! CLM Gridcell index | ||
| INTEGER :: cg | ||
| INTEGER :: pg | ||
| INTEGER :: i,j,k ! Counters | ||
| INTEGER :: cnt ! Counters | ||
| INTEGER :: cnt_interp ! Counter for interpolation grid cells | ||
|
|
@@ -935,6 +940,8 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f) | |
| do i = 1, dim_obs | ||
| obs(i) = clm_obs(i) | ||
|
|
||
| if(clmupdate_swc==1) then | ||
|
|
||
| do g = begg,endg | ||
| newgridcell = .true. | ||
|
|
||
|
|
@@ -1005,9 +1012,100 @@ SUBROUTINE init_dim_obs_f_pdaf(step, dim_obs_f) | |
| end if | ||
|
|
||
| end if | ||
|
|
||
| end do | ||
| end do | ||
|
|
||
| else if(clmupdate_T==1 .or. clmupdate_T==2 .or. clmupdate_T==3) then | ||
| #ifdef CLMFIVE | ||
| ! patch loop | ||
| do g = begg,endg | ||
| newgridcell = .true. | ||
|
|
||
| do p = begp,endp | ||
|
|
||
| pg = patch%gridcell(p) | ||
|
|
||
| if(pg == g) then | ||
| if(newgridcell) then | ||
| ! Sets first patch/column in a gridcell. TODO: Make | ||
| ! patch / column information part of the observation | ||
| ! file | ||
|
|
||
| if(is_use_dr) then | ||
| deltax = abs(lon(g)-clmobs_lon(i)) | ||
| deltay = abs(lat(g)-clmobs_lat(i)) | ||
| end if | ||
|
|
||
| if(((is_use_dr).and.(deltax<=clmobs_dr(1)).and.(deltay<=clmobs_dr(2))).or. & | ||
| ((.not. is_use_dr).and.(longxy_obs(i) == longxy(g-begg+1)) .and. (latixy_obs(i) == latixy(g-begg+1)))) then | ||
|
|
||
| ! Set index in state vector, LST will be computed | ||
| ! for first patch appearing here | ||
| obs_index_p(cnt) = state_clm2pdaf_p(p,1) | ||
|
|
||
| !write(*,*) 'obs_index_p(',cnt,') is',obs_index_p(cnt) | ||
| obs_p(cnt) = clm_obs(i) | ||
| if(multierr==1) clm_obserr_p(cnt) = clm_obserr(i) | ||
| cnt = cnt + 1 | ||
|
|
||
|
Comment on lines
+1042
to
+1050
|
||
| end if | ||
|
|
||
| newgridcell = .false. | ||
|
|
||
| end if | ||
| end if | ||
|
|
||
| end do | ||
| end do | ||
| #else | ||
| ! gridcell loop | ||
| do g = begg,endg | ||
|
|
||
| if(is_use_dr) then | ||
| deltax = abs(lon(g)-clmobs_lon(i)) | ||
| deltay = abs(lat(g)-clmobs_lat(i)) | ||
| end if | ||
|
|
||
| if(((is_use_dr).and.(deltax<=clmobs_dr(1)).and.(deltay<=clmobs_dr(2))).or. & | ||
| ((.not. is_use_dr).and.(longxy_obs(i) == longxy(g-begg+1)) .and. (latixy_obs(i) == latixy(g-begg+1)))) then | ||
| obs_index_p(cnt) = g-begg+1 | ||
| end if | ||
|
|
||
| !write(*,*) 'obs_index_p(',cnt,') is',obs_index_p(cnt) | ||
| obs_p(cnt) = clm_obs(i) | ||
| if(multierr==1) clm_obserr_p(cnt) = clm_obserr(i) | ||
| cnt = cnt + 1 | ||
|
|
||
| end do | ||
| #endif | ||
| else | ||
|
|
||
| print *, "TSMP-PDAF mype(w)=", mype_world, ": WARNING unsupported update in setting obs_index_p." | ||
| print *, "TSMP-PDAF mype(w)=", mype_world, ": WARNING using default gridcell loop." | ||
| ! call abort_parallel() | ||
|
|
||
| ! gridcell loop with layer information as default! | ||
| do g = begg,endg | ||
|
|
||
| if(is_use_dr) then | ||
| deltax = abs(lon(g)-clmobs_lon(i)) | ||
| deltay = abs(lat(g)-clmobs_lat(i)) | ||
| end if | ||
|
|
||
| if(((is_use_dr).and.(deltax<=clmobs_dr(1)).and.(deltay<=clmobs_dr(2))).or. & | ||
| ((.not. is_use_dr).and.(longxy_obs(i) == longxy(g-begg+1)) .and. (latixy_obs(i) == latixy(g-begg+1)))) then | ||
| obs_index_p(cnt) = g-begg+1 + ((endg-begg+1) * (clmobs_layer(i)-1)) | ||
| end if | ||
|
|
||
| !write(*,*) 'obs_index_p(',cnt,') is',obs_index_p(cnt) | ||
| obs_p(cnt) = clm_obs(i) | ||
| if(multierr==1) clm_obserr_p(cnt) = clm_obserr(i) | ||
| cnt = cnt + 1 | ||
|
|
||
| end do | ||
|
|
||
| end if | ||
|
|
||
| end do | ||
|
|
||
| if(obs_interp_switch==1) then | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -125,6 +125,7 @@ SUBROUTINE init_dim_obs_pdaf(step, dim_obs_p) | |||
| #ifdef CLMFIVE | ||||
| use GridcellType, only: grc | ||||
| use ColumnType, only : col | ||||
| use PatchType, only : patch | ||||
| ! use GetGlobalValuesMod, only: GetGlobalWrite | ||||
| ! use clm_varcon, only: nameg | ||||
| use enkf_clm_mod, only: state_clm2pdaf_p | ||||
|
|
@@ -141,6 +142,8 @@ SUBROUTINE init_dim_obs_pdaf(step, dim_obs_p) | |||
| USE enkf_clm_mod, only: domain_def_clm | ||||
| USE enkf_clm_mod, only: get_interp_idx | ||||
| use enkf_clm_mod, only: clmstatevec_allcol | ||||
| use enkf_clm_mod, only: clmupdate_swc | ||||
| use enkf_clm_mod, only: clmupdate_T | ||||
| !hcp end | ||||
| #endif | ||||
| #endif | ||||
|
|
@@ -160,9 +163,12 @@ SUBROUTINE init_dim_obs_pdaf(step, dim_obs_p) | |||
| integer :: ierror | ||||
| INTEGER :: max_var_id ! Multi-scale DA | ||||
| INTEGER :: sum_dim_obs_p | ||||
| INTEGER :: p ! CLM Patch index | ||||
| INTEGER :: c ! CLM Column index | ||||
| INTEGER :: g ! CLM Gridcell index | ||||
| INTEGER :: cg | ||||
| INTEGER :: pg | ||||
| INTEGER :: pc | ||||
| INTEGER :: i,j,k ! Counters | ||||
| INTEGER :: cnt ! Counters | ||||
| INTEGER :: cnt_interp ! Counter for interpolation grid cells | ||||
|
|
@@ -928,6 +934,8 @@ SUBROUTINE init_dim_obs_pdaf(step, dim_obs_p) | |||
| do i = 1, dim_obs | ||||
| obs(i) = clm_obs(i) | ||||
|
|
||||
| if(clmupdate_swc==1) then | ||||
|
|
||||
| do g = begg,endg | ||||
| newgridcell = .true. | ||||
|
|
||||
|
|
@@ -998,9 +1006,101 @@ SUBROUTINE init_dim_obs_pdaf(step, dim_obs_p) | |||
| end if | ||||
|
|
||||
| end if | ||||
|
|
||||
| end do | ||||
| end do | ||||
|
|
||||
| else if(clmupdate_T==1 .or. clmupdate_T==2 .or. clmupdate_T==3) then | ||||
| #ifdef CLMFIVE | ||||
| ! patch loop | ||||
| do g = begg,endg | ||||
| newgridcell = .true. | ||||
|
|
||||
| do p = begp,endp | ||||
|
|
||||
| pg = patch%gridcell(p) | ||||
| pc = patch%column(p) | ||||
|
||||
| pc = patch%column(p) |
Copilot
AI
Mar 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clmupdate_T==1 the state vector appears to be patch-based, but this branch picks only the first patch per gridcell and assigns obs_index_p for that single patch. This likely leaves many patches never observed/updated. Please clarify the intended domain (gridcell vs patch) for update_T==1 and adjust observation indexing accordingly (e.g., use a gridcell-mean state layout, or generate indices for all relevant patches).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs for
CLM:update_Tdescribe modes 0/1/2, but the code now implementsclmupdate_T==3as well. Please update this section to document mode 3 (and any differences between 2 and 3) so users don’t accidentally enable an undocumented mode.