-
Notifications
You must be signed in to change notification settings - Fork 57
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
add an option to obtain the cocurrent drag and heat transfer coeffients #113
Conversation
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 new routines, everything needs to be documented in doxygen style.
shared/surface_flux.F90
Outdated
do i = 1, niter | ||
do j = 1, size(avail) | ||
if (avail(j) .and. seawater(j)) then | ||
call iter_monin_obukhov_ocean ( & | ||
z_atm(j), u_atm(j), v_atm(j), w_atm(j), thv_atm(j), q_atm(j), & | ||
u_surf(j), v_surf(j), thv_surf(j), q_surf0(j), & | ||
rough_mom(j), rough_heat(j), rough_moist(j), & | ||
cd_m(j), cd_t(j), cd_q(j), u_star(j), b_star(j) ) | ||
endif | ||
enddo | ||
enddo | ||
endif | ||
|
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.
Need to address whether we want to push the j-loop and even the i-loop down into the inter_monin_obukhov_ocean routine. It will make for cleaner code here as well as the constant context switching in and out of the function to calculate a point at a time.
@baoqiang80 Just wanted to follow up since this looks like it needs some updates. This will need the comments above addressed before we can get this merged in and included in a release. It also looks like its failing the CI testing with these errors: /__w/FMScoupler/FMScoupler/t/null.NgMaM3/src/coupler/shared/surface_flux.F90:120:26:
120 | use ocean_rough_mod, only: cal_z0_hwrf17, cal_zt_hwrf17, read_ocean_rough_scheme
| 1
Error: Symbol 'cal_z0_hwrf17' referenced at (1) not found in module 'ocean_rough_mod'
/__w/FMScoupler/FMScoupler/t/null.NgMaM3/src/coupler/shared/surface_flux.F90:120:41:
120 | use ocean_rough_mod, only: cal_z0_hwrf17, cal_zt_hwrf17, read_ocean_rough_scheme
| 1
Error: Symbol 'cal_zt_hwrf17' referenced at (1) not found in module 'ocean_rough_mod'
/__w/FMScoupler/FMScoupler/t/null.NgMaM3/src/coupler/shared/surface_flux.F90:120:56:
120 | use ocean_rough_mod, only: cal_z0_hwrf17, cal_zt_hwrf17, read_ocean_rough_scheme
| 1
Error: Symbol 'read_ocean_rough_scheme' referenced at (1) not found in module 'ocean_rough_mod' Do these changes rely on other component changes? Our simple CI test for this repository just uses the *_null components, but they will need to be updated as well if there are any API changes made to the component modules they are based on. |
@rem1776 Yes, this relies on another merge request for ice_param update which was just merged into the main branch today with the tag (2024.01.01). Could you please give another try? Also, I made some further update on this merge request today by moving the do loop into the subroutine following Rusty's suggestion. Thanks |
@baoqiang80 Thanks for making those changes. I reran the CI but it failed again, this time it got past the full coupler build but failed with the simple coupler. I took a look at it and it seems the change we are missing is in |
@rem1776 I changed simple/surface_exchange.F90. Would you please give another try? |
shared/surface_flux.F90
Outdated
@@ -173,12 +176,17 @@ module surface_flux_mod | |||
!! heat. This option is available for legacy purposes, and is not recommended for | |||
!! new experiments. | |||
logical :: ncar_ocean_flux_multilevel = .false. !< Use NCAR climate model turbulent flux calculation described by Large and Yeager, allows for different reference height for wind, temp and spec. hum. | |||
logical :: do_iter_monin_obukhov = .false. !< If .TRUE, call monin obukhov funtions a couple of times to update |
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.
Minor typo funtions
.
shared/surface_flux.F90
Outdated
real :: bulk_zu = 10. !< Reference height for wind speed (meters) | ||
real :: bulk_zt = 10. !< Reference height for atm temperature (meters) | ||
real :: bulk_zq = 10. !< Reference height for atm humidity (meters) | ||
logical :: raoult_sat_vap = .false. !< Reduce saturation vapor pressure to account for seawater | ||
logical :: do_simple = .false. | ||
|
||
integer :: niter = 5 !< iteration times to call iter_monin_obukhov_ocean. Typically 3-5 times should converge |
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.
Would like to see this be more descriptive to match the trigger do_iter_monin_obukhov
, perhaps niter_monin_obukhov
. If updated, please change all instances.
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.
After this fix, I will approve this for merge.
shared/surface_flux.F90
Outdated
@@ -272,7 +281,7 @@ subroutine surface_flux_1d ( & | |||
q_atm, q_surf0, dw_atmdu, dw_atmdv, w_gust, & | |||
zu, zt, zq | |||
|
|||
integer :: i, nbad | |||
integer :: i, j, nbad |
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.
Please remove the j declaration since the creation of the iter_monin_obukhov_ocean function removed the need for it here.
shared/surface_flux.F90
Outdated
subroutine iter_monin_obukhov_ocean ( & | ||
z_atm, u_atm, v_atm, w_atm, thv_atm, q_atm, & | ||
u_surf, v_surf, thv_surf, q_surf0, & | ||
rough_mom, rough_heat, rough_moist, & | ||
cd_m, cd_t, cd_q, u_star, b_star, avail, seawater) | ||
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! | ||
! Right now, it is only effective when ocean_rough = 'hwrf17', but this | ||
! can be expanded if necessarily to incorporate other roughness schemies | ||
! contact: Kun.Gao@noaa.gov; Baoqiang.Xiang@noaa.gov | ||
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! |
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 documentation for this routine should be in doxygen style and above the subroutine declaration:
!> \brief (description of that this does)
!! \note Right now, it is only effective when ocean_rough = 'hwrf17', but this
!! can be expanded if necessarily to incorporate other roughness schemies
!! contact: Kun.Gao@noaa.gov; Baoqiang.Xiang@noaa.gov
subroutine iter_monin_obukhov_ocean ( &
z_atm, u_atm, v_atm, w_atm, thv_atm, q_atm, &
u_surf, v_surf, thv_surf, q_surf0, &
rough_mom, rough_heat, rough_moist, &
cd_m, cd_t, cd_q, u_star, b_star, avail, seawater)
shared/surface_flux.F90
Outdated
real , intent(in), dimension(:) :: & | ||
z_atm, u_atm, v_atm, w_atm, thv_atm, q_atm, & | ||
u_surf, v_surf, thv_surf, q_surf0 | ||
|
||
real , intent(inout), dimension(:) :: & | ||
rough_mom, rough_heat, rough_moist, & | ||
cd_m, cd_t, cd_q, u_star, b_star | ||
logical, intent(in), dimension(:) :: & | ||
avail, seawater | ||
|
||
! local var | ||
real, dimension(size(z_atm(:))) :: & | ||
flux_q, q_star, & | ||
ref_u, ref_v, u10, del_m, del_h, del_q, & | ||
rough_mom1, rough_heat1, rough_moist1 | ||
integer i, j |
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.
All of these variables need to be documented in doxygen style because this is a new routine
shared/surface_flux.F90
Outdated
rough_mom, rough_heat, rough_moist, & | ||
cd_m, cd_t, cd_q, u_star, b_star, avail, seawater) | ||
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! | ||
! Right now, it is only effective when ocean_rough = 'hwrf17', but this |
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.
You should probably check the roughness scheme and print a note to the screen if it's not hwrf17
For the current model setting, the ocean roughness for momentum, heat and moisture is input variables which are calculated based on the atmospheric condition at the previous time step. We add one option to update the ocean roughness by iterating the monin obukhov function so as to obtain concurrent roughness, drag and heat/moisture coefficients.