Skip to content
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

TSMP-PDAF Update #231

Merged
merged 9 commits into from
Jul 12, 2024
3 changes: 3 additions & 0 deletions bldsva/intf_DA/pdaf/arch/config/linux_gfortran_openmpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ AR_SPEC =
# Specifications for ranlib
RAN_SPEC =

# Specification for directory holding modules (-module for Intel, -J for GNU)
MODULEOPT = -J

# Include path for MPI header file
MPI_INC = __MPI_INC__

Expand Down
3 changes: 3 additions & 0 deletions bldsva/intf_DA/pdaf/arch/config/linux_ifort.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ AR_SPEC =
# Specifications for ranlib
RAN_SPEC =

# Specification for directory holding modules (-module for Intel, -J for GNU)
MODULEOPT = -module

# Include path for MPI header file
MPI_INC = __MPI_INC__

Expand Down
7 changes: 5 additions & 2 deletions bldsva/intf_DA/pdaf/framework/mod_read_obs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,11 @@ end subroutine clean_obs_pf
!> @param[in] fn Filename of the observation file
!> @param[out] nn number of observations in `fn`
!> @details
!> Reads the content of the variable name `no_obs` from NetCDF
!> file `fn` using subroutines from the NetCDF module.
!> Reads the content of the variable (!) named `no_obs` from
!> NetCDF file `fn`.
!>
!> Uses subroutines from the NetCDF module.
!>
!> The result is returned in `nn`.
!>
!> The result is used to decide if the next observation file is
Expand Down
4 changes: 4 additions & 0 deletions bldsva/intf_DA/pdaf/framework/obs_op_pdaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ SUBROUTINE obs_op_pdaf(step, dim_p, dim_obs_p, state_p, m_state_p)
DO i = 1, dim_obs_p
! Equation for LST computation from Kustas2009, Eq(7)
! http://dx.doi.org/10.1016/j.agrformet.2009.05.016
!
! Comment: Fractional vegetation cover (Eq(8) from Kustas2009)
! currently implemented with simplified settings: Vegetation
! clumping parameter `Omega=1`; radiometer view angle `phi=0`
m_state_p(i) &
= (exp(-0.5*clm_paramarr(obs_index_p(i))) &
*state_p(obs_index_p(i))**4 &
Expand Down
19 changes: 19 additions & 0 deletions bldsva/intf_DA/pdaf/framework/parser_mpi.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ MODULE parser
!
! !USES:
USE mpi
USE mod_parallel_pdaf, &
ONLY: abort_parallel
IMPLICIT NONE
SAVE

Expand Down Expand Up @@ -215,6 +217,8 @@ SUBROUTINE parse_string(handle, charvalue)
! *** local variables ***
CHARACTER(len=100) :: string
CHARACTER(len=100) :: parsed_string
CHARACTER(len=110) :: str1_check
CHARACTER(len=110) :: str2_check
LOGICAL :: modified

! *** Initialize ***
Expand All @@ -234,6 +238,21 @@ SUBROUTINE parse_string(handle, charvalue)
DO i = 1, command_argument_count() - 1
CALL get_command_argument(i, str1)
CALL get_command_argument(i+1, str2)

! Add check for cut strings longer than 100 characters
CALL get_command_argument(i, str1_check)
CALL get_command_argument(i+1, str2_check)
IF (mype == 0) THEN
IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN
WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long."
WRITE (*,'(2x, a, a)') "called handle=", string
WRITE (*,'(2x, a, a)') "parsed handle=", str1
WRITE (*,'(2x, a, a)') "parsed input(cut)=", str2
call abort_parallel()
END IF
END IF


#endif
IF (str1 == TRIM(string)) THEN
! Format specifier is needed for reading paths. Using
Expand Down
6 changes: 6 additions & 0 deletions bldsva/intf_DA/pdaf/model/clm5_0/enkf_clm_mod_5.F90
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ end subroutine set_clm_statevec

subroutine update_clm(tstartcycle, mype) bind(C,name="update_clm")
use clm_varpar , only : nlevsoi
use clm_time_manager , only : update_DA_nstep
use shr_kind_mod , only : r8 => shr_kind_r8
use ColumnType , only : col
use clm_instMod, only : soilstate_inst, waterstate_inst
Expand Down Expand Up @@ -343,6 +344,11 @@ subroutine update_clm(tstartcycle, mype) bind(C,name="update_clm")
error stop "Not implemented: clmupdate_swc.eq.2"
endif

! CLM5: Update the Data Assimulation time-step to the current time
! step, since DA has been done. Used by CLM5 to skip BalanceChecks
! directly after the DA step.
call update_DA_nstep()

! write updated swc back to CLM
if(clmupdate_swc.ne.0) then

Expand Down
9 changes: 6 additions & 3 deletions doc/content/setup_tsmp/input_cmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ filter. See [Command Line Examples](#command-line-examples).
`obs_filename` (string) Prefix for observation files.

Note: The prefix for observation files cannot be longer than 100
characters! Otherwise, the observation filename will be cropped. In
these cases, usually an error message `No such file or directory` is
thrown in `next_observation_pdaf.F90`.
characters! Otherwise, the observation filename will be cropped.

Tip: Try to use relative paths as input to `obs_filename`.

If observation filenames are not found, an error message `No such file
or directory` is printed out in `next_observation_pdaf.F90`.

## rms_obs ##

Expand Down
Loading