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

Hard-coded NUDAPT statement in SLUCM #2084

Open
chenghaow opened this issue Aug 1, 2024 · 2 comments
Open

Hard-coded NUDAPT statement in SLUCM #2084

chenghaow opened this issue Aug 1, 2024 · 2 comments

Comments

@chenghaow
Copy link

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

@chenghaow chenghaow changed the title Issue - hard-coded NUDAPT statement in SLUCM Hard-coded NUDAPT statement in SLUCM Aug 1, 2024
@cenlinhe
Copy link
Contributor

cenlinhe commented Aug 1, 2024

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
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants