Skip to content

Hard-coded NUDAPT statement in SLUCM #2084

Open
@chenghaow

Description

When running the single-layer UCM with NUDAPT data, the phys/module_sf_noahdrv.F file currently uses the following statements to determine whether to print information of urban parameters or not from module_sf_urban.F:

! NUDAPT for SLUCM
mh_urb = mh_urb2d(I,J)
stdh_urb = stdh_urb2d(I,J)
lp_urb = lp_urb2d(I,J)
hgt_urb = hgt_urb2d(I,J)
lf_urb = 0.0
DO K = 1,4
lf_urb(K)=lf_urb2d(I,K,J)
ENDDO
frc_urb = frc_urb2d(I,J)
lb_urb = lb_urb2d(I,J)
check = 0
if (I.eq.73.and.J.eq.125)THEN
check = 1
end if

This if (I.eq.73.and.J.eq.125)THEN seems to be a legacy hard-coded statement for inspection using a specific domain configuration, which will not work for different domains. This might need to be removed. NoahmpUrbanDriverMainMod.F in HRLDAS also uses this statement.

@cenlinhe

Activity

changed the title Issue - hard-coded NUDAPT statement in SLUCM Hard-coded NUDAPT statement in SLUCM on Aug 1, 2024
cenlinhe

cenlinhe commented on Aug 1, 2024

@cenlinhe
Contributor

I think you are right. This is likely a legacy. My guess is that this code is trying to print out the NUDAPT data to make sure they are read in correctly but do not want to print out the NUDAPT parameter values for the entire domain. So here it selects an arbitrary point for the printing purpose. I think if we remove this here, we could just set the check=0 so that it will not print out the variables for the entire domain which is too much. I also cc'ed @xuelingbo @doan-van , just in case they have any other thoughts based on their SLUCM modeling experience.

xuelingbo

xuelingbo commented on Aug 7, 2024

@xuelingbo

I agree with @cenlinhe that we can remove the conditional statements and keep the check = 0, so that it will not print out messages when we call urban. However, this may be inconvenient for debugging or user verification of key values. So a more refined approach would be to follow what we did in urban_var_init (https://github.com/wrf-model/WRF/blob/0a11865f97680fdd6865b278ea29d910e5db3ed7/phys/module_sf_urban.F#L2994C7-L3046C14):

IF (CHECK.EQ.0)THEN
     IF(IVGTYP(I,J).EQ.1)THEN
        write(mesg,*) 'Sample of Urban settings'
        WRITE_MESSAGE(mesg)
        ...
        write(mesg,*) 'num_urban_hi', num_urban_hi
        WRITE_MESSAGE(mesg)
        CHECK = 1
     END IF
END IF

Move check into subroutine URBAN to be a local variable and set to be 0, and then print the message once by change the value of check to be 1 after print.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Hard-coded NUDAPT statement in SLUCM · Issue #2084 · wrf-model/WRF