Skip to content

Checking intent (inout) vs (out) for shared version of WRF-MPAS Noah LSM#5

Open
davegill wants to merge 13 commits intodevelopfrom
intent
Open

Checking intent (inout) vs (out) for shared version of WRF-MPAS Noah LSM#5
davegill wants to merge 13 commits intodevelopfrom
intent

Conversation

@davegill
Copy link
Owner

@davegill davegill commented Mar 15, 2019

/gpfs/fs1/scratch/gill/WRF_SHARED_PHYSICS/WRF/

After bug fix, ran a test with previous vs instrumented code. The instrumented code had every variables that was modified between WRF and MPAS initialized as HUGE. The only two fields that are
different between the two short runs are two diagnostic fields: SMCREL and NOAHRES.

> ../../external/io_netcdf/diffwrf INIT_HUGE_intent/wrfout_d01_2000-01-24_12:00:00 INIT_develop/wrfout_d01_2000-01-24_12:00:00 
 Just plot  F
Diffing INIT_HUGE_intent/wrfout_d01_2000-01-24_12:00:00 INIT_develop/wrfout_d01_2000-01-24_12:00:00
 Next Time 2000-01-24_12:00:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
 Next Time 2000-01-24_12:03:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
   NOAHRES      2031    2   0.2317166950E+39   0.1723680767E+00 -39   0.2317E+39   0.3146E+39
 Next Time 2000-01-24_12:06:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
    SMCREL      8124    3   0.2317166950E+39   0.8362615464E+00 -38   0.2317E+39   0.7161E+38
   NOAHRES      2031    2   0.2317166950E+39   0.2442041814E+00 -38   0.2317E+39   0.1825E+39
 Next Time 2000-01-24_12:09:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
    SMCREL      8124    3   0.2317166950E+39   0.8358389944E+00 -38   0.2317E+39   0.7161E+38
   NOAHRES      2031    2   0.2317166950E+39   0.2705677661E+00 -38   0.2317E+39   0.1619E+39
 Next Time 2000-01-24_12:12:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
    SMCREL      8124    3   0.2317166950E+39   0.8355161195E+00 -38   0.2317E+39   0.7161E+38
   NOAHRES      2031    2   0.2317166950E+39   0.2709646415E+00 -38   0.2317E+39   0.1617E+39

@davegill davegill changed the title Checking intent in out for WRF MPAS Noah LSM swap Checking intent (inout) vs (out) for shared version of WRF-MPAS Noah LSM Mar 15, 2019
@davegill
Copy link
Owner Author

@mgduda @weiwangncar @dudhia @kkeene44 @smileMchen
Folks,
Please take a look at these diffs. I don't know Laura's github ID.

@mgduda
Copy link
Collaborator

mgduda commented Mar 21, 2019

@ldfowler58 Just bringing you into the conversation...

@weiwangncar
Copy link

@davegill Do you mean SH2OIN becomes 10^38?

@davegill
Copy link
Owner Author

Do you mean SH2OIN becomes 10^38?
@weiwangncar
Wei,
In the computation (I will replicate it for posterity), the value of SH2OIN is 10^38 (probably that is HUGE). That variable is used, and should not be.

@weiwangncar
Copy link

@davegill I will rephrase my question: did you set this field, SH2OIN, to a huge number, or this field contains huge numbers as a result of changing other fields to huge numbers?

davegill added a commit to wrf-model/WRF that referenced this pull request Mar 26, 2019
TYPE: bug fix

KEYWORDS: Noah LSM sh2o unified MPAS

SOURCE: internal

DESCRIPTION OF CHANGES: 
Problem:
A single variable was used as two calling arguments in a subroutine. Inside the subroutine, the 
separate names were pointing to the same memory and were treated differently.

Solution:
Since the two instances of the array were treated as IN and OUT, a copy of the array was made and
passed in as separately named input field. There were two locations to fix.

LIST OF MODIFIED FILES: 
M phys/module_sf_noahlsm.F

TESTS CONDUCTED: 
1. Comparing the results before vs after show no bit-for-bit differences (what we wanted).
```
../../external/io_netcdf/diffwrf INIT_develop/wrfout_d01_2000-01-24_12:00:00 INIT_FIX_dev/wrfout_d01_2000-01-24_12:00:00 
 Just plot  F
Diffing INIT_develop/wrfout_d01_2000-01-24_12:00:00 INIT_FIX_dev/wrfout_d01_2000-01-24_12:00:00
 Next Time 2000-01-24_12:00:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
 Next Time 2000-01-24_12:03:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
 Next Time 2000-01-24_12:06:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
 Next Time 2000-01-24_12:09:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
 Next Time 2000-01-24_12:12:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
```
2. When the code was instrumented, the only differences were diagnostic only. No differences in any other WRF output fields. See davegill#5 (github.com/davegill/WRF PR 5).
mbartolini18 pushed a commit to mbartolini18/WRFV4_spp that referenced this pull request Jul 13, 2022
TYPE: bug fix

KEYWORDS: Noah LSM sh2o unified MPAS

SOURCE: internal

DESCRIPTION OF CHANGES: 
Problem:
A single variable was used as two calling arguments in a subroutine. Inside the subroutine, the 
separate names were pointing to the same memory and were treated differently.

Solution:
Since the two instances of the array were treated as IN and OUT, a copy of the array was made and
passed in as separately named input field. There were two locations to fix.

LIST OF MODIFIED FILES: 
M phys/module_sf_noahlsm.F

TESTS CONDUCTED: 
1. Comparing the results before vs after show no bit-for-bit differences (what we wanted).
```
../../external/io_netcdf/diffwrf INIT_develop/wrfout_d01_2000-01-24_12:00:00 INIT_FIX_dev/wrfout_d01_2000-01-24_12:00:00 
 Just plot  F
Diffing INIT_develop/wrfout_d01_2000-01-24_12:00:00 INIT_FIX_dev/wrfout_d01_2000-01-24_12:00:00
 Next Time 2000-01-24_12:00:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
 Next Time 2000-01-24_12:03:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
 Next Time 2000-01-24_12:06:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
 Next Time 2000-01-24_12:09:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
 Next Time 2000-01-24_12:12:00
     Field   Ndifs    Dims       RMS (1)            RMS (2)     DIGITS    RMSE     pntwise max
```
2. When the code was instrumented, the only differences were diagnostic only. No differences in any other WRF output fields. See davegill/WRF#5 (github.com/davegill/WRF PR 5).
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

Successfully merging this pull request may close these issues.

3 participants