Skip to content

Adding Solar diagnostics package #1103

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

Closed
wants to merge 11 commits into from

Conversation

pedro-jm
Copy link
Contributor

@pedro-jm pedro-jm commented Feb 25, 2020

TYPE: New feature

KEYWORDS: WRF-Solar, diagnostics

SOURCE: Timothy Juliano, Pedro Jimenez, Ju-Hye Kim (NCAR/RAL)

DESCRIPTION OF CHANGES:

Replaces PR #1047 "Adding Solar diagnostic package"

We have created a new diagnostic package for users with interests in parameters that are potentially relevant to solar applications. In the new package, we calculate: solar zenith angle, clearness index, 2-D max cloud fraction, water vapor path, liquid water path, ice water path, snow water path, total water path (liquid + ice + snow), liquid cloud effective radius, ice effective radius, snow effective radius, liquid cloud optical thickness, ice optical thickness, snow optical thickness, cloud base height, and cloud top height. Also, for liquid and ice variables, we calculate the 'total' water path, effective radius, and optical thickness, where the 'total' variables also account for subgrid (unresolved) hydrometeors. We have re-organized the radiation driver code in order to expose the calculation of unresolved hydrometeors during time steps when the radiation physics is not called. After re-organization of the radiation driver code, we ran two tests: one using the default develop code and the other using our modified code with the solar diagnostics turned off; the outputs are bit-for-bit equivalent.

All of the variables added within the solar diagnostics package are defined on the 2-D grid and also as timeseries variables in Registry/registry.solar_fields and the variables are calculated in phys/module_diag_solar.F. The solar diagnostics package is activated by setting solar_diagnostics = 1 in the WRF namelist.input file:

&diags
 solar_diagnostics         =  1
 /

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M Registry/registry.em_shared_collection
M dyn_em/module_first_rk_step_part1.F
M main/depend.common
M phys/Makefile
M phys/module_diagnostics_driver.F
M phys/module_radiation_driver.F
M share/module_check_a_mundo.F
M share/wrf_timeseries.F
M run/README.namelist
M run/README.tslist
M test/em_real/examples.namelist

LIST OF NEW FILES:
A Registry/registry.solar_fields
A phys/module_diag_solar.F

TESTS CONDUCTED: Ran a full diurnal cycle of a real case over the Pacific Northwest, USA. The simulation completed, with the output being bit-for-bit equal to the output from a simulation with the same configuration ran using an un-modified version of the code. Shown below are a few images of sample solar package variables for the domain in addition to a time series at the location indicated by a star.

swp

ts_sza

ts_wp

RELEASE NOTES:
A new diagnostic package for users with interests in parameters that are potentially relevant to solar applications is added. In the new package, The following variables are calculated: solar zenith angle, clearness index, 2-D max cloud fraction, water vapor path, liquid water path, ice water path, snow water path, total water path (liquid + ice + snow), liquid cloud effective radius, ice effective radius, snow effective radius, liquid cloud optical thickness, ice optical thickness, snow optical thickness, cloud base height, and cloud top height. Also, for liquid and ice variables, the 'total' water path, effective radius, and optical thickness are computed, where the 'total' variables also account for subgrid (unresolved) hydrometeors. The diagnostics is activated by namelist variable solar_diagnostics (=1) in namelist record @Diags. (Thanks to Timothy Juliano, Pedro Jimenez, Ju-Hye Kim of NCAR/RAL)

@pedro-jm pedro-jm requested review from a team as code owners February 25, 2020 18:09
@pedro-jm pedro-jm changed the title Solar diags 2 Adding Solar diagnostics package Feb 25, 2020
! shallow cumulus parameterization
CALL wrf_debug ( 200 , ' call shallow_cumulus_driver' )

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedro-jm Can you leave the blank lines alone?

@davegill
Copy link
Contributor

@twjuliano @pedro-jm @dudhia @weiwangncar
There seems to be LOTS of changes in the radiation driver outside the scope of the diagnostics changes. Perhaps lots of re-organizing? That really should not be part of the PR.

cldfra(i,k,j)=cldfra(i,k,j)+ccldfra(i,k,j)-0.5*(ITRMX+ITRMN)
ENDDO
ENDDO
ENDDO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twjuliano @pedro-jm These were added in recent PR #921

do k=1,pver

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twjuliano @pedro-jm Please leave the blank lines as they are. Thanks.

@dudhia
Copy link
Collaborator

dudhia commented Feb 25, 2020 via email

@weiwangncar
Copy link
Collaborator

@twjuliano @pedro-jm @dudhia As a general rule, any reorganization of the code should be done in a separate PR, not to be mixed with the actual code changes.

@pedro-jm
Copy link
Contributor Author

The changes in the radiation driver are necessary to expose the calculation of unresolved hydrometeors to non radiation time steps (We are moving code). The diagnostics package calculates the column-integrated hydrometeor content of the unresolved hydrometeors and this is why we moved the code. Also, the unresolved hydrometeors are used by FARMS every model time step to calculate the surface irradiance. How should we move forward with this?

The removing of blank lines is a side effect of conflict resolution. We can add them back if necessary.

@weiwangncar
Copy link
Collaborator

@pedro-jm OK if the moving of the code is necessary, please add some notes in your PR. Please recover some code you deleted and add the blank lines back, both in readiation driver, and module_first_rk_step_part1.F. Thanks. Because you moved code around in radiation driver, we would like to know if it has any impact in the before and after results.

@pedro-jm
Copy link
Contributor Author

OK @twjuliano will add back the blank lines and improve the PR notes. The missing/removed code is actually there. It was just moved.

@twjuliano did a couple of sims one with the develop branch as it was a few days ago and the other with develop + solar diag and he found bit for bit equivalent results. He is going to add this info to the PR note.

If you find any other thing let us know.

@twjuliano
Copy link
Contributor

@davegill @weiwangncar @dudhia @pedro-jm I've just pushed two separate commits. The first one adds back the blank lines that were unintentionally removed in previous commits. The second one makes some minor modifications to the diag_solar code to account for unresolved hydrometeors when no only using icloud=3 in order to better align with the modifications made in the radiation driver. I hope that this PR is now good to go. Please let me know if any other changes are necessary.

Also, because @pedro-jm generated this new PR, I am not able to edit the PR note. Are you able to grant me access to edit? Thanks.

@weiwangncar
Copy link
Collaborator

@twjuliano Thank you for bringing back the blank lines. If you send us a few sentences about the need to re-organize the radiation driver code, we can help to add it in.
I wonder if you could do two tests, one using the default develop code (git checkout develop), and the other using this code but with solar diag off. We would like to know if the results are identical.

#else
grid%ts_tsk(n,i) = grid%nmm_tsk(ix,iy)
#endif
grid%ts_tslb(n,i) = grid%tslb(ix,1,iy)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this line back in, too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

#endif
grid%ts_tsk(n,i) = 1.E30
grid%ts_tslb(n,i) = 1.E30

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this line back

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@twjuliano
Copy link
Contributor

@weiwangncar I conducted these two tests yesterday and the results were identical. Unfortunately, the login nodes for Cheyenne and Casper are currently unavailable, so I am not able to access the simulation output. Hopefully I can do this tomorrow AM. Thanks.

@weiwangncar
Copy link
Collaborator

@twjuliano That's good to know. I am now ok with this PR. Don't forget to edit the PR message.

@twjuliano
Copy link
Contributor

@weiwangncar PR message has been edited.

Copy link
Collaborator

@weiwangncar weiwangncar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release note added.

@davegill
Copy link
Contributor

@dudhia @weiwangncar
Folks,
This does not build with NMM
module_PHYSICS_CALLS.F is missing solar_opt

@davegill
Copy link
Contributor

Closed, will use #1110 "Adding Solar diagnostics package"
This PR does not build NMM

@davegill davegill closed this Feb 27, 2020
@davegill davegill mentioned this pull request Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants