-
Notifications
You must be signed in to change notification settings - Fork 161
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
Regional inlinepost #229
Regional inlinepost #229
Conversation
io/post_regional.F90
Outdated
foundland = .false. | ||
foundice = .false. | ||
|
||
if(mype==0) print *,'dong haha', wrt_int_state%FBCount |
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 am laughing!
There are 2857 lines in |
There is no fundamental difference between these two modules, apart from some minor grid related stuff, some error checking, rounding values to |
Well, one major change you did not mention is the "fillvalue" that global
does not need while regional does need to identify undefined points and
fill with post undefined value. Any idea how to sync those changes without
adding if statement for "global" and "regional" around every field?
…On Tue, Jan 12, 2021 at 5:06 PM Dusan Jovic ***@***.***> wrote:
There are 2857 lines in io/post_regional.F90, of which more than 80% are
reproduced (copied and pasted) from io/post_gfs.F90.
There is so much duplication in this code.
There is no fundamental difference between these two modules, apart from
some minor grid related stuff, some error checking, rounding values to
spval, debug prints and such thing. These two modules should be merged
and in few cases those minor differences can be made by checking the grid
type. I do not see the need to just copy entire module, and maintain
virtually identical code, close to 3000 lines, in two places.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TMV7ONQOVKCMND6WFDSZTBUJANCNFSM4V7YBHJA>
.
|
If the global field value is close to spval, shouldn't it also be rounded to spval, why is this specific to regional. |
Because global fields are valid on all the grid points, but regional output
may be bigger than the computational domain so undefined values are filled
on those points and they have to be refilled with post undefined value so
that those points won't participate in the computation.
On Tue, Jan 12, 2021 at 5:26 PM Dusan Jovic <notifications@github.com>
wrote:
… Well, one major change you did not mention is the "fillvalue" that global
does not need while regional does need to identify undefined points and
fill with post undefined value. Any idea how to sync those changes without
adding if statement for "global" and "regional" around every field?
… <#m_2724442750951071135_>
On Tue, Jan 12, 2021 at 5:06 PM Dusan Jovic *@*.***> wrote: There are
2857 lines in io/post_regional.F90, of which more than 80% are reproduced
(copied and pasted) from io/post_gfs.F90. There is so much duplication in
this code. There is no fundamental difference between these two modules,
apart from some minor grid related stuff, some error checking, rounding
values to spval, debug prints and such thing. These two modules should be
merged and in few cases those minor differences can be made by checking the
grid type. I do not see the need to just copy entire module, and maintain
virtually identical code, close to 3000 lines, in two places. — You are
receiving this because you authored the thread. Reply to this email
directly, view it on GitHub <#229 (comment)
<#229 (comment)>>, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AI7D6TMV7ONQOVKCMND6WFDSZTBUJANCNFSM4V7YBHJA
.
If the global field value is close to spval, shouldn't is also rounded to
spval, why is this specific to regional.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TKRWIMYPMMLZE7S7ETSZTECJANCNFSM4V7YBHJA>
.
|
Exactly. That means all those if tests can be applied to both global and regional. Since global fields are 'never' close to |
Why do we need to add extra computation for global fields?
…On Tue, Jan 12, 2021 at 8:20 PM Dusan Jovic ***@***.***> wrote:
Because global fields are valid on all the grid points, but regional
output may be bigger than the computational domain so undefined values are
filled on those points and they have to be refilled with post undefined
value so that those points won't participate in the computation.
Exactly. That means all those if tests can be applied to both global and
regional. Since global fields are 'never' close to spval (because they
are valid everywhere), the if condition will never be true, and so they
will remain as they are. Which means one module can be used for both global
and regional configuration.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TKP6DKWXF3BDD7I2CDSZTYNHANCNFSM4V7YBHJA>
.
|
Which computation? An if tests? Do we know how much slower 'regional' version is? A second or few seconds? Even if its's few seconds, this is running on write component which will not slow down the forecast tasks. |
Again, global fields do not need to check those fillvalues, what you
propose is to add extra computation for global fields which is redundant.
The only purpose I see from making global field going through these
fillvalue check is to merge the two files. Fillalue check is required for
regional applications, we have no way to compare how much slowness for
regional application because without those fillvalue checks model failed
with seg fault. Write component could slow down the forecast tasks if it
runs slower than forecast, you then have to increase the computer resources
as a price of combining the two files together. Also at this time, global
and regional output similar fields, we don't know if it will change in the
future when the two use different physics.
…On Wed, Jan 13, 2021 at 8:29 AM Dusan Jovic ***@***.***> wrote:
Why do we need to add extra computation for global fields?
Which computation? An if tests? Do we know how much slower 'regional'
version is? A second or few seconds? Even if its's few seconds, this is
running on write component which will not slow down the forecast tasks.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TNK35LKF3GKD4GMUADSZWNYNANCNFSM4V7YBHJA>
.
|
I am not proposing to compare regional configuration with or without fillvalue checks. I'm proposing to check the global configuration. The argument about regional using different physics than global is irrelevant here. What if two global configurations are using different physics? Are you going to create yet another copy, for those two different global physics configurations. |
OK, if I understand correctly, the argument is: global fields do not need
to check fillvalue as their values are valid., the code is clean. Why do we
want to add extra code to check fillvalue for the global fields?
…On Wed, Jan 13, 2021 at 8:54 AM Dusan Jovic ***@***.***> wrote:
I am not proposing to compare regional configuration with or without
fillvalue checks. I'm proposing to check the global configuration.
If the write component is slower than forecast we need to add more
resources to it to always be faster, I understand that. The question is how
much will those extra ifs slow down the write component?
The argument about regional using different physics than global is
irrelevant here. What if two global configurations are using different
physics? Are you going to create yet another copy, for those two different
global physics configurations.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TMOZTNB7IWY4FYLMI3SZWQZRANCNFSM4V7YBHJA>
.
|
To avoid duplication of almost 3000 lines of code. Do we know how much the extra code costs in terms of wall clock time? How about setting spval to the same value as fillvalue, and avoid those checks even in regional? After all, both spval and fillvall are just some arbitrary large values. They do not have to be different. |
Well, post is using one single spval for all undefined values for all the
variables, while fields in the model have their own undefined values,
unless we want to change the values in fv3 dycore.
…On Wed, Jan 13, 2021 at 9:14 AM Dusan Jovic ***@***.***> wrote:
OK, if I understand correctly, the argument is: global fields do not need
to check fillvalue as their values are valid., the code is clean. Why do we
want to add extra code to check fillvalue for the global fields?
To avoid duplication of almost 3000 lines of code.
Do we know how much the extra code costs in terms of wall clock time?
How about setting spval to the same value as fillvalue, and avoid those
checks even in regional? After all, both spval and fillvall are just some
arbitrary large values. They do not have to be different.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TN7CZ5DLN5FOGXZDU3SZWTF3ANCNFSM4V7YBHJA>
.
|
Why can't those two undefined values be the same? |
One is defined in dycore from GFDL, one is defined by post. We need to get all involved parties to discuss this. |
spval is set to 9.99e20 in set_postvars_regional: why can't it be set to the same value as fillvalue here? Why do we need to discuss this with 'all involved parties'? |
Thanks for all of your questions. I'd suggest you read post code. Again,
standalone post uses a single spval as undefined value, so inlinepost
defines the same value used in standalone post. While different model
fields have different filled values. To use a single undefined value in the
model and post requires coordination from different repositories and
additional post updates.
…On Wed, Jan 13, 2021 at 9:47 AM Dusan Jovic ***@***.***> wrote:
One is defined in dycore from GFDL, one is defined by post. We need to get
all involved parties to discuss this.
spval is set to 9.99e20 in set_postvars_regional:
https://github.com/junwang-noaa/fv3atm/blob/4801afd0cfe41fcd8f488c892c8b513d297927ee/io/post_regional.F90#L545
why can't it be set to the same value as fillvalue here? Why do we need to
discuss this with 'all involved parties'?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TL4MWLQKR6LWZ566KDSZWW7ZANCNFSM4V7YBHJA>
.
|
Why can't standalone post can use the spval set to 9.99e20 in the main program in the post (WRFPOST.f), while inline post use the spval set to fill value in the model. Any value of spval that can be used to identify missing values ( 9.99e20 or 1e30). Does it matter what the actual value is. After all this is used to set bitmap in the grib files, I do not think the actual value is written out in the post output, at least it should't be. |
Even in the standalone post I see two different values for spval used:
depending on the file type of file format. I do not see why we can't set it to |
fillvalue is different for different fields.
…On Wed, Jan 13, 2021 at 10:26 AM Dusan Jovic ***@***.***> wrote:
Even in the standalone post I see two different values for spval used:
WRFPOST.f: spval = 9.9e10
WRFPOST.f: spval = 9.99e20
depending on the file type of file format. I do not see why we can't set
it to spval = fillvalue, in the write component.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TM6LKXTZ26ABYZS6C3SZW3SNANCNFSM4V7YBHJA>
.
|
Then let's make them use the same value, and send that value to post as an indicator for missing data. If you are so concerned about the cost of those fillvalue check in the global configuration you should be also, if not more, concerned about the cost in the regional configuration and try to avoid them, if they are not necessary. |
io/post_regional.F90
Outdated
@@ -2802,7 +2802,11 @@ subroutine set_postvars_regional(wrt_int_state,mpicomp,setvar_atmfile, & | |||
do i=ista, iend | |||
!assign sst | |||
if (sm(i,j) /= 0.0 .and. ths(i,j) /= spval) then | |||
if ((sice(i,j) >= 0.15) then |
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.
@junwang-noaa A extra left bracket makes compiling failure.
Sorry, forgot to commit the fix. Please try again. Thanks
…On Mon, Feb 15, 2021 at 4:02 PM WenMeng-NOAA ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In io/post_regional.F90
<#229 (comment)>:
> @@ -2802,7 +2802,11 @@ subroutine set_postvars_regional(wrt_int_state,mpicomp,setvar_atmfile, &
do i=ista, iend
!assign sst
if (sm(i,j) /= 0.0 .and. ths(i,j) /= spval) then
+ if ((sice(i,j) >= 0.15) then
@junwang-noaa <https://github.com/junwang-noaa> A extra left bracket
makes compiling failure.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#229 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TK6T6Q2UNOQXEVUME3S7GDVBANCNFSM4V7YBHJA>
.
|
Jun,
One more commit might be needed in post_regional.F90 line 2915:
----------------
-!$omp parallel do default(none) private(i,j)
shared(jsta,jend,ista,iend,spval,lp1,sm,ths,sst,thz0,pint)
+!$omp parallel do default(none) private(i,j)
shared(jsta,jend,ista,iend,spval,lp1,sm,ths,sst,thz0,pint,sice)
Thanks,
Wen
…On Mon, Feb 15, 2021 at 7:44 PM Jun Wang ***@***.***> wrote:
Sorry, forgot to commit the fix. Please try again. Thanks
On Mon, Feb 15, 2021 at 4:02 PM WenMeng-NOAA ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In io/post_regional.F90
> <#229 (comment)>:
>
> > @@ -2802,7 +2802,11 @@ subroutine
set_postvars_regional(wrt_int_state,mpicomp,setvar_atmfile, &
> do i=ista, iend
> !assign sst
> if (sm(i,j) /= 0.0 .and. ths(i,j) /= spval) then
> + if ((sice(i,j) >= 0.15) then
>
> @junwang-noaa <https://github.com/junwang-noaa> A extra left bracket
> makes compiling failure.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#229 (review)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AI7D6TK6T6Q2UNOQXEVUME3S7GDVBANCNFSM4V7YBHJA
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALQGNETJGJRKU2BY7WSEKJ3S7G5UZANCNFSM4V7YBHJA>
.
--
Wen Meng
IMSG at NOAA/NWS/NCEP/EMC
5830 University Research Ct., Room 2070
College Park, MD 20740
Wen.Meng@noaa.gov
301-683-3779
|
Fixed.
On Mon, Feb 15, 2021 at 7:53 PM WenMeng-NOAA <notifications@github.com>
wrote:
… Jun,
One more commit might be needed in post_regional.F90 line 2915:
----------------
-!$omp parallel do default(none) private(i,j)
shared(jsta,jend,ista,iend,spval,lp1,sm,ths,sst,thz0,pint)
+!$omp parallel do default(none) private(i,j)
shared(jsta,jend,ista,iend,spval,lp1,sm,ths,sst,thz0,pint,sice)
Thanks,
Wen
On Mon, Feb 15, 2021 at 7:44 PM Jun Wang ***@***.***> wrote:
> Sorry, forgot to commit the fix. Please try again. Thanks
>
> On Mon, Feb 15, 2021 at 4:02 PM WenMeng-NOAA ***@***.***>
> wrote:
>
> > ***@***.**** commented on this pull request.
> > ------------------------------
> >
> > In io/post_regional.F90
> > <#229 (comment)>:
> >
> > > @@ -2802,7 +2802,11 @@ subroutine
> set_postvars_regional(wrt_int_state,mpicomp,setvar_atmfile, &
> > do i=ista, iend
> > !assign sst
> > if (sm(i,j) /= 0.0 .and. ths(i,j) /= spval) then
> > + if ((sice(i,j) >= 0.15) then
> >
> > @junwang-noaa <https://github.com/junwang-noaa> A extra left bracket
> > makes compiling failure.
> >
> > —
> > You are receiving this because you were mentioned.
> > Reply to this email directly, view it on GitHub
> > <
#229 (review)
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/AI7D6TK6T6Q2UNOQXEVUME3S7GDVBANCNFSM4V7YBHJA
> >
> > .
> >
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#229 (comment)>, or
> unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ALQGNETJGJRKU2BY7WSEKJ3S7G5UZANCNFSM4V7YBHJA
>
> .
>
--
Wen Meng
IMSG at NOAA/NWS/NCEP/EMC
5830 University Research Ct., Room 2070
College Park, MD 20740
***@***.***
301-683-3779
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#229 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TIEOK4FMD3LAFJRHRLS7G6WTANCNFSM4V7YBHJA>
.
|
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 changes look good to me.
* upstream/develop: Add missing OpenMP dependency to ccpp/data/CMakeLists.txt and ccpp/driver/CMakeLists.txt (NOAA-EMC#258) Regional inlinepost (NOAA-EMC#229)
Description
Issue(s) addressed
Link the issues to be closed with this PR, whether in this repository, or in another repository.
Testing
Testing has been done on hera, orion and dell with regional_quilt and regional_quilt_hafs regression test tests and in high resolution LAM and HAFS tests.
Because of change item 2), the stretch nest tests need a input file INPUT/grid.nest02.tile7.nc to generate the forecast grid.
Dependencies
Related PRs: