-
Notifications
You must be signed in to change notification settings - Fork 136
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
Mixed precision topography_mod #1250
Conversation
topography/gaussian_topog.F90
Outdated
@@ -105,9 +110,9 @@ module gaussian_topog_mod | |||
!! by variables in the namelist. | |||
subroutine gaussian_topog_init ( lon, lat, zsurf ) |
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.
Is there a reason why this subroutine wasn't moved to the inc file?
wlat = 15.*dtr; if (present(wlatd)) wlat=wlatd*dtr | ||
rlon = 0. ; if (present(rlond)) rlon=rlond*dtr | ||
rlat = 0. ; if (present(rlatd)) rlat=rlatd*dtr | ||
olon = 90.0_lkind*dtr; if (present(olond)) olon=olond*dtr |
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.
olon=real(olond*dtr, lkind) and for below too
|
||
! compute gaussian-shaped mountain | ||
do j=1,size(lat(:)) | ||
dy = abs(lat(j) - olat) ! dist from y origin | ||
yy = max(0., dy-rlat)/wlat | ||
yy = max(0.0_lkind, dy-rlat)/wlat |
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 module levels variables are declared as r8_kind. you need to convert them to lkind
topography/topography.F90
Outdated
integer :: namelen | ||
function open_topog_file ( ) | ||
logical :: open_topog_file | ||
real(kind=r8_kind) :: r_ipts, r_jpts |
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.
Im wondering if these could be r4_kind if the whole purpose of this subroutine is to open the topog_file and get ipts and jpts
@mcallic2 i made a PR to your branch |
Mm topography
! The variables in this namelist are only used when routine | ||
! <TT>gaussian_topog_init</TT> is called. The namelist variables | ||
! are dimensioned (by 10), so that multiple mountains can be generated. | ||
!> @brief Returns a simple surface height field that consists of a single |
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.
can you move this comment block to right above the function its documenting (get_gaussian_topog). If its not right above the routine it won't get parsed correctly.
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.
fixed in b55e5da
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 only moved the first 3 lines (the brief description), the rest ofit needs to be moved (lines 35-59)
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.
I'm still lost as to why the comments for get_gaussian_topog is moved here above gaussian_topog_init...
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.
Do lines 34-35 also need to be moved down?
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.
I think they are fine, it'll just read the first !> as the brief descriptions and the second part as the expanded.
! The variables in this namelist are only used when routine | ||
! <TT>gaussian_topog_init</TT> is called. The namelist variables | ||
! are dimensioned (by 10), so that multiple mountains can be generated. | ||
!> The height, position, width, and elongation of the mountain |
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.
I think this comment block has been misplaced?
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.
@rem1776 told me to move it for documentation, it's right above get_gaussian_topog
now
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.
it seems to be above gaussian_topog_init?
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.
its below end subroutine gaussian_topog_init
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.
olat = 45.0_r8_kind*dtr; if (present(olatd)) olat=real(olatd*dtr,r8_kind) | ||
wlon = 15.0_r8_kind*dtr; if (present(wlond)) wlon=real(wlond*dtr,r8_kind) | ||
wlat = 15.0_r8_kind*dtr; if (present(wlatd)) wlat=real(wlatd*dtr,r8_kind) | ||
olon = 90.0_r8_kind*real(dtr, r8_kind); if (present(olond)) olon=real(olond*dtr,r8_kind) |
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.
real(dtr,r8_kind) isn't necessary but ok.
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.
I ran gcc with all the warnings and there were conversion errors, I can send you the path to it if you wanna look
BREAKING CHANGE: In coupler_types.F90, `coupler_nd_field_type` and `coupler_nd_values_type` have been renamed to indicate real kind value: `coupler_nd_real4/8_field_type` and `coupler_nd_real4/8_values_type`. The `bc` field within `coupler_nd_bc_type` was modified to use r8_kind within the value and field types, and an additional field added `bc_r4` to use r4_kind values. Includes: * feat: eliminate use of real numbers for mixed precision in `block_control` (#1195) * feat: mixed precision field_manager (#1205) * feat: mixed precision random_numbers_mod (#1191) * feat: mixed precision time_manager reals to r8 and clean up (#1196) * feat: mixed Precision tracer_manager (#1212) * Mixed precision monin_obukhov (#1116) * Mixed precision: `monin_obukhov` unit tests (#1272) * mixed-precision diag_integral_mod (#1217) * mixed precision time_interp (#1252) * mixed precision interpolator_mod (#1305) * Mixed precision astronomy (#1092) * Mixed precision `data_override_mod` (#1323) * mixed precision exchange (#1341) * coupler mixed precision (#1353) * Mixed precision topography_mod (#1250) --------- Co-authored-by: rem1776 <[email protected]> Co-authored-by: MiKyung Lee <[email protected]> Co-authored-by: mlee03 <[email protected]> Co-authored-by: Caitlyn McAllister <[email protected]> Co-authored-by: Jesse Lentz <[email protected]>
Description
Adds mixed precision capabilities to topography_mod
Fixes # (issue)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note
any relevant details for your test configuration (e.g. compiler, OS). Include
enough information so someone can reproduce your tests.
Checklist:
make distcheck
passes