Skip to content
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

Cloud ceiling failure in in-line post #139

Closed
WenMeng-NOAA opened this issue Jun 18, 2020 · 3 comments
Closed

Cloud ceiling failure in in-line post #139

WenMeng-NOAA opened this issue Jun 18, 2020 · 3 comments

Comments

@WenMeng-NOAA
Copy link
Collaborator

The PR #136 which was merged to branch release/gfs_v16 output cloud ceiling from GFS V16. This commit causes in-line post hung in processing total cloud fraction. It was figured out that the GFS
total cloud fraction computation call UPP subroutine AllGETHERV which uses MPI_COMM_WORLD.
The MPI_COMM_WORLD will make all tasks including forecasting syncing each other. That makes the whole FV3 job hung.

@WenMeng-NOAA
Copy link
Collaborator Author

WenMeng-NOAA commented Jun 18, 2020

Per Fanglin's suggestion, a new total cloud fraction is initialized at individual grid instead of a box of
grids as:
DO L=LM,1,-1
DO J=JSTA,JEND
DO I=1,IM
FRAC =CFR(I,J,L) !- 3D cloud fraction (from radiation)
PCLDBASE=PMID(I,J,L)
IF (PCLDBASE>=PTOP_LOW) THEN
CFRACL(I,J)=MAX(CFRACL(I,J),FRAC)
ELSE IF (PCLDBASE>=PTOP_MID) THEN
CFRACM(I,J)=MAX(CFRACM(I,J),FRAC)
ELSE
CFRACH(I,J)=MAX(CFRACH(I,J),FRAC)
ENDIF
TCLD(I,J)=MAX(TCLD(I,J),FRAC)
ENDDO ! I
ENDDO ! J
ENDDO ! L

This algothrims will avoid calling AllGETHERV.

@WenMeng-NOAA
Copy link
Collaborator Author

Some explanation from from Fanglin:
Brad Ferrier developed a scheme to compute instantaneous Low/Mid/High cloud fraction in the POST for NAM. Because NAM only has binary cloud fraction (1 vs 0) at each model grid, he used the average over a few model grids over a 14 by 14-km box to compute "fractional" cloud cover.

Wen applied this method to compute L/M/H clouds for GFS.v16. It worked in offline post; however, it caused the model to hang in inline post. After long hours of debugging, Wen found an MPI gathering call in this section of code caused the model to hang. The computation needs points cross the boundary within each task.

Unlike NAM, GFS produces true fractional cloud. We decided to get rid of this complicated approach, and instead use GFS predicted 3-D cloud fraction to derive L/M/H clouds. This "NAM" approach is ad hoc in nature since the corresponding L/M/H cloud-base pressures are nevertheless not areal averages ( PCLDBASE=PMID(I,J,L) !-- Using PCLDBASE variable for convenience).

@WenMeng-NOAA
Copy link
Collaborator Author

On 06/19/2020, the branch release/gfs_v16 was committed at @35daf5 with PR #142. A new tag
upp_gfsv16_release.v1.0.9 was created for gfs v16 parallel run and installing post/8.0.9.

ywangwof pushed a commit to ywangwof/EMC_post that referenced this issue Jun 23, 2020
* Initialize 'recname' array to blank-fill array and avoid GNU compiling errors

* DTC Sync: Add gtg stub routines to community makefile

* DTC Sync: Use 'INCLUDE mpif.h' instead of 'use mpi' for community portability

* DTC Sync: Declare 'recname' array with blanks to avoid compiling errors with GNU for community

* Temporary hack for community testing until EMC provides fix

* DTC Sync: Add and update initialization routines for NMM binary read. These have not been used operationally for a while. This commit is merely to sync the community and emc code bases

* Link data files in run_unipost scripts for updated CRTM

* First stage in removing WRF dependency: if you copy in the frame/, main/, and external/ directories from a successful WRF build, this version compiles and runs successfully

* Second stage in removing WRF dependency:

Now contains a new directory "wrf_io/" with its own makefile for building the
relevant WRF code. Now you no longer have to pre-build WRF, only run the
configure script to create a configure.wrf file.

To build this version:

 - Copy in the external/, frame/, inc/, main/, Registry/, and tools/ directories from the RAW UNBUILT WRF source code into the new wrf_io/ directory
 - Copy in a configure.wrf file created with that same WRF source code

Should be able to pare down the above list soon, many of them are only
needed for one or two files (or perhaps ultimately none)

This version was tested with the WRF V4.0 Friendly Release NOAA-EMC#3 (git hash e96ef955), but it should work for a wide range of WRF code

* Adding a basic .gitignore file

* AR should not be defined with flags, this can be different for some platforms

* Third stage in removing WRF dependency: configure.wrf file no longer
included in wrf_io makefile

* Adding some makefiles to track their changes

* Updating clean rules to fully clean wrf_io stuff

* Fourth stage in removing WRF dependency: configure.wrf no longer required!

 - Added "wrf_makerules" file to be included in a couple makefiles
   - Contains configure.wrf preamble and postamble, but no
     platform-specific stuff!
 - Still need to copy over WRF directories, *and* properly check out the
   versioned files
 - Modified frame Makefile to remove an unnecessary compilation
   - Hopefully a lot more of this in the future!

* Versioning WRF files in frame/ directory. No longer need to copy this directory in from WRF.

* Fifth stage in removing WRF dependency: frame/ and main/ no longer need
to be copied in to wrf_io/ directory

 - Versioned the necessary files in frame/ from the WRF build.
 - Moved depend.common from main/ to frame/, and versioned it
 - Build libwrflib.a in the wrf_io/ directory instead of wrf_io/main/

* Fix hard-coding of netCDF path. Don't think it was causing problems but hard-coding is bad, mmkay

* Finally started testing other platforms/options. This commit fixes serial compile. Tests now work for options 7 and 8 (gfortran serial and parallel)

 - Link in already existing UPP stub mpi library files for WRF serial build
 - Use already existing "sw_dmparallelflag" switch from configure to
   pass -DSTUBMPI flag for serial builds
 - Remove clog.o file which is only needed for log file buffering, which
   is rarely used in WRF and certainly not supported for UPP.
 - While removing log file buffering, also remove a lot of other
   unsupported CPP ifdefs

* Properly add serial flags. Not sure why the previous version was working...

* Clean out the remnants of the platform-specific wrf_makerules.

* More wrf_makerules cleanup

* Even more wrf_makerules cleanup

* Continuing wrf_makerules cleanup, adding to-do list under version control

* Removing a lot more unnecessary make rules.;

* Remove registry requirement, and version necessary tools/ files

* Adding a bunch of external io source code

* Remove inc/ dependency...very close to removing all WRF dependency!

Move inc files to frame

* Added rest of external libraries, now just testing to go!

* Delete todo

* Get rid of diffwrf, stub-ify wrf_debug

* Remove wrf_debug completely. There, one WRF routine down, seventeen thousand to go...

* Remove ESMF dependence. Lots of line savings here!

* Remove WRF grib1 stuff, really making progress now!

* Remove rest of WRF grib stuff, references to UPP libs from WRF

* Removing fftpack

* Get rid of some "undefined reference" warnings

* Move module_internal_header_util and intio_tags to io_int directory

* Remove module_wrf_error, add some stub routines to compensate

* Remove module_machine

* Remove module_driver_constants and wrf_shutdown

* Tools directory removed!

* Removing ioapi_share directory, redistributing necessary include files

* libwrf no longer necessary

* Remove a whole bunch more residual WRF crap. Mostly unnecessary
and/or unused variables and CPP flags.

* Remove module_wrfsi_static

* Remove WRF links from unipost run script; include necessary lookup
tables in parm/ directory

* Remove unnecessary subroutines from pack_utils

* Delete a whole bunch more unneeded flags and variables

* Remove unnecessary netCDF code

* Remove frame directory, final step before consolidating everything in
its final location

 - Remove some old WRF mpi stub stuff
 - Move pack_utils to io_int directory and build it there
 - Remove a couple more unnecessary makefile items
 - Remove now-defunct frame directory and associated make/clean rules

* Remove a test routine and an unnecessary variable

* A bunch more stuff stripped out.

 - Remove unused variable from io_int.F90
 - Remove unused module module_io_int_read
 - Remove old logic involving 4DVAR
 - Remove a bunch more unneeded/unused makefile variables

* Start moving code to final location: move io_int code to wrf_io top directory

* Continue moving WRF code to its final location: move io_netcdf code to wrf_io top directory

* Move WRF remnants to their final location: src/lib/wrf_io

* Deprecate capability to read WRF binary I/O files

* Remove rest of WRF binary I/O code

 - Remove binary I/O code and makefiles
 - Add a stub "wrf_message" routine to wrf_io.F90 (the netCDF I/O routine)

* Some final touch-ups to this code before rigorous testing.

 - Condense wrf_makerules and roll it into the main wrf_io makefile
 - Remove some unipost source files which are unnecessary without wrf
   binary IO
 - Remove old "Makefile_nowrf" which was from an old partial attempt to
   remove WRF depepndency

* Remove old changes inadvertantly included in removal of WRF dependency

* Update ip libraries to v3.0.0

* Update g2 libraries to v3.1.0

* Update sigio libraries to v2.1.0

* Update g2tmpl libraries to v1.5.0

* update version info/log

* Updating UPP run scripts and Adding V4 Users Guide

* Add GFS config files and update run scripts

* Update V4 UG

* Adding "-w" flag to wrf_io makefile to suppress "Unrecognized directive" warnings

* Update V4.0 UG required libraries section

* Bug fix for nemsiompiio format for FV3GFS processing

* Edit version info for updated nemsio library to v2.2.2 and bug fix uppv4.0.1

* Nemosio fix for serial built from Laurie.

* modifying scripts to use binarynemsiompiio format for FV3

* Modify error message to reflect binarynemsiompiio

* Jira NOAA-EMC#121 Fix typo in Wind Energy Calculation (UPP ID 411) in MDL2AGL.f

* Jira NOAA-EMC#122 Fix error that grabs incorrect EL level for TAUX/TAUY calculation in CALTAU.f

* Jira NOAA-EMC#131 Fix error in pname for updraft helicity in post_avblflds.xml

* Jira NOAA-EMC#132 Fix incorrect grib codes in RQSTFLD.f for wind shear variables

* Jira NOAA-EMC#135 Fix allocation issue for PSFC in Block 2 of SURFCE.f

* Jira NOAA-EMC#136 Fix typo in CALRAD_WCLOUD_newcrtm.f of incorrect iget ID for INSAT 3D select_channels_L call

* Jira NOAA-EMC#139 Remove 10 m POT/SPFH from wrf params - not available for wrf output

* Fix mods for selecting satellite channels in CALRAD_WCLOUD_newcrtm.f and SELECT_CHANNELS.f

* modify makefile to conditionally add mpi stubs for serial builds, instead of always including by default

* Modified GRIB1 Table lyx doc for available satellite channels/levels

* Fix allocation issue for PSFC in Block 2

* Fix mods for selecting satellite channels in CALRAD_WCLOUD_newcrtm

* Fix grib codes in RQSTFLD.f for wind shear variables

* Fix incorrect EL level for TAUX/TAUY calculation

* Fix typo in Wind Energy Calculation (UPP ID 411)

* Fix index for SEVIRI

* Fix index for SEVIRI

* Manual sync of EMC mods to comupp

* Add new routines to makefile

* Update crtm submodule to v2.2.3.1_subset tag to include GOES-R/abi* fix files

* Add abi* coefficient files to run scripts for GOES16 products

* Remove extraneous great than sign

* Comment out #if for testing. PGI and GNU fail with this syntax

* Remove extraneous greater than sign

* Revert MXLVL back to 70. Comment out #if 0 lines.

* Remove nmm-binary read file. No longer supported

* Add community contorl filse and update others

* Chain make commands with "&&" instead of ";", this prevents infinite loop when you call clean script under certain circumstances (like when you forget to check out the crtm submodule)

* Initial progress in new build system:
 - add NCEPLIBS_DIR environment variable into configure.upp
 - use NCEPLIBS_DIR to point to external build of wrfio libraries
 - Remove our build of wrf_io in favor of external build

Compile tested only on Cheyenne, gnu compilers for now

* Missed one change to properly build with external WRF libs

* Removing netCDF discovery dialogue. We should not try to be cute or clever. If the user wants NETCDF they should be able to set a variable or make some links.

* Revamping how we check for JASPER libraries/include files.

Old code incorrectly and unexpectedly defaulted to a (typically) non-existant location for JASPERLIB and JASPERINC.

In keeping with the 'Let the configure script fail'(TM) philosophy I'm trying to instill here,
if the user does not set JASPER or JASPERLIB and JASPERINC variables, unless one of the old default locations exists,
the configure script will fail with an error message. Users can overwrite this message by setting NOGRIB2 environment
variable, but support for GRIB1 will be going away in the not-so-distant future!

* Deleting old deprecated makefiles clogging up src/unipost

* Use consistent JASPER variables between UPP and NCEPlibs. Allow old JASPER variables for back-compatibility

* Use external GRIB2 (g2 and g2tmpl) library builds. Tested on Cheyenne for gnu compilers so far.

* Got unipost to build with all (possible) external libraries

* ndate and copygb also build with external libraries (cheyenne, gnu)

* Since we no longer have a native copy of "params_grib2_tbl_new" file from g2tmpl libraries, we need to link it in from NCEPlibs in the run scripts

* The big merge is here! Moved all the comupp framework to the top level.
This includes the following moves/renames:

comupp/c*                   --> configure|compile|clean
comupp/makefile             --> makefile
comupp/arch/                --> sorc/arch
comupp/src/lib              --> sorc/comlibs (this includes crtm submodule!)
comupp/src/unipost/makefile --> sorc/ncep_post.fd/makefile_dtc

Modifications had to be made to clean/configure/compile scripts, as well
as the community makefiles and Config.pl, to accomodate the new directory structure
and naming schemes. Additionally, there was one divergence point between
the community source code and the ncep source code: GFSPOST was split
into GFSPOST and GFSPOSTSIG.

This version compiles successfully, but the merge is not really finished.
Lots more work before this is considered a complete merge.

* Remove top-level makefile to simplify things

* Removing the last of the external libraries

* Under comupp, moving contents of docs/ parm/ and scripts/ to corresponding top-level directories. A few files in comupp/parm/ remain since they have files in the top-level parm/ that have differences; Tracy is sorting those out.

* Modify clean and compile scripts for proper directory navigation; this was causing the clean script to fail to remove the old configure.upp file

* In clean script, only try to find custom make command if configure.upp exists and is not empty

* Overhaul ncep_post build script: use bash instead of sh, machine name is now a command-line argument

* Using feedback from Tracy, removing or renaming the rest of the files in comupp/parm. Now everything should be in the top-level parm/ directory

* Add top-level .gitignore file so git will not track compilation files such as configuration files, .exe, .o, and .mod

* Updating community runscripts

 - Copy compiled executable to exec/ directory instead of bin/, mirroring
ncep build
 - Update runscripts
   - Replacing references to ndate with `date` utility (thanks to Ka Yee Wong)
   - Removing references to copygb
   - Reference new location of executable in exec/ rather than bin/
   - Reference post_avblflds_comm.xml rather than post_avblflds.xml

Did not update global runscript as this appears to be unsupported anyway

* Should not try to set NETCDF environment variable; if it was not already taken care of in the configure step something has already broken anyway

* Convert clean and compile scripts to bash to match other scripts (and avoid using the non-recommended csh varieties). Also a bit of cleanup of my sloppy handling of directory switching in these scripts

* One more csh->bash change: need to use !-s test instead of -z

* A few more tidying changes for clean: restore use of printf to get newlines, echo all the clean -a remove statements

* Allow ncep_post compilation from ./compile script by providing argument

* Removing the last of the comupp remnants

* Fix dumb mistake: need to actually create the exec directory we want to use!

* Add Darwin, gnu stanza to configure.defaults

* Accidentally removed last NULL stanza from configure.defaults; this could cause weird failures

* Prepping configure architecture to allow individual locations of NCEP libs to be specified

 - Rather than just setting NCEPLIB_DIR in configure.upp, now use that environment variable
   to set the library and include files in configure.upp
 - Remove old, obsolete definition of WRF_DIR in configure.upp

* One last overhaul of configure system

 - Add framework (but not functionality) for NCEP libraries to be linked individually
 - Handle the inclusion of NCEPLIBLIB and NCEPLIBINC in configure script rather than Config.pl
   - This will allow easier handling of multiple library and include paths once the full functionality is added
 - Gracefully handle unsupported platforms; if OS/MACH combo is not available don't even use Config.pl

* Forgot to remove some debug prints from configure script

* Continuing overhaul of configure system to allow linking of libraries individually

 - Set up array of required directories, and remove directories as they are detected.
   If all required directories are found with the appropriate files, NCEPLIBS is not required
   - This is only completed for library files, not other required files
 - Fix sed issues that wouldn't substitute properly for strings with spaces in them
 - Add in an echo line that somehow got removed

* One final intermediate commit on new config system before the big finale

 - Forgot to add exit statements to failure conditions when library files are missing
 - Accidentally left some important lines commented
 - Fix some indentation

* Configure system now fully mix-and-match configurable for NCEP libraries

 - All include files now included as well. I'm kind of shocked at how few include files are actually necessary...
 - Use an array for directories where multiple files from the same library are needed
 - Remove some old comments and echo statements

* A few miscellaneous improvements to configure script

 - Explicitly reference bash rather than sh in shebang
 - A few more detailed comments
 - Remove unnecessary assignment of input argument

* More portable solution for GRIB2 table: use already existing params_grib2_tbl_new in top-level parm directory

* Fix locations of params_grib2_tbl_new and crtm coefficient files

* Adding version numbers and precision info to library names

Since UPP specifically needs 4-byte reals in its libraries we should specify this in the library names rather than leaving it ambiguous
This also follows standard EMC naming conventions so ideally we can use libraries from any source
Furthermore, if a different library version is desired, it can be specified using an environment variable at configure time

* Remove jasper requirement; this is obsolete since it is only needed for compiling GRIB2 libraries

* Add mods from develop

* Update dtc makefile to compile new routines

* Add check to configure script to ensure CRTM submodule has been checked out

* fix for filling a handful of 2d variables currently causing a divide-by-zero error when run in debug mode.
Currently filled with 'k' which fills with zeros
Needs to fill with 'll' which is what's being filled within the larger loop and different index value than 'k'

* Fix ID index in WRF-CHEM SMOKE block, which currently causes failed build in debug mode

* Modification to makefile for compiling new routines added from develop

* Remove blank line from params_grib2_tbl_new that causes memory fault for certain cases ran with GNU

* Add the flat file name (postxconfig-NT.txt) to fix the itag bug for GFS case.

* Change MXLVL back to 70 for COMMCODE in RQSTFLD.F

* Add if-statement for imp_physics when calling GSD VIS (dependency is that imp_physics=28)

* Fix the way that the parameter 'rg' is read in, should be read in from params.F

* Temporarily restoring the ability to run build_ncep_post.sh without an argument.

* Turn off 2 fields not available for ARW, which were causing seg faults during run time

* Initialize n_clouds=0 and print msg, when not defined for certain mp_physics

* 1) Initialize variables as zero that were not initialized for ARW, causing failures in debug mode
2) Comment out 2 lines in INITPOST.F that were causing failures in debug mode

* Add v4.1-beta UG

* Add new HWRF routine

* Allocate/deallocate HWRF variables

* Add HWRF variables

* Add cd10 and ch10 code for HWRF

* Add new HWRF vars to rqstflds

* Add new HWRF routine to community makefile

* Add NMM model for HWRF

* WRF-NMM has no data for certain fields at the boundary. Add code to mask out the outermost rows and columns if maptype==203

* Correct typo made when adding support for advected Ferrier-Aligo microphysics

* Add Himawari sensors

* Removing serial option for this release

* Better solution to avoid changing option numbering: if users select a serial option, output an error message

* Updated submodule to new tag v2.2.3.2_subset to include Himawari files

* Add Himwari sensors to list

* Fix typo in grib tables

* Change name of UPPV4.1 users guide

* Add link to Himawari fix files in run scripts

* Switch to updated Himawari fix files for testing

* Updates to v4.1 UG

* Fix Out of Bound Exception in GFSPOST.F (NOAA-EMC#100)

* Fix out-of-bound error in tpause routine in GFSPOST.F

* Fix use of undefined variables.

* Updating CRTM submodule tag to include Himawari fix file

* Added the FV3 netcdf option and updated the netcdf format check for FV3 option.

* Update run_unipost

* Update run_unipostandgempak

* Update run_unipostandgrads

* Update parameter files and remove some duplicate parameter files

* Update scripts with bug fix for FV3GFS data and minor file link corrections

* Minor updates to fields file info

* Add GOES 16/17 to GRIB2 table, update release tag in UG

* remove redundant line

* Add extra space character to obslist to fit himarwari

* Add Himawari-8 for grib2

* Link Himawari-8 coefficient files in run_unipost script

* Add new HWRF routine to EMC makefile

* Changed HWRF's CD/CH exchange coeff UPP IDs to 922 and 923 to avoid conflict with Himawari number set

* Set n_clouds to zero to avoid crashes. This got removed in merge somehow

* Remove old lyx doc files

* Remove old run scripts

* Initialize aerosol coeffs and remove mp check to avoid failures

* Add Himawari coefficients to list of crtm files to link

* Modify UPP IDs for Himawari fields to avoid conflict with other model output

* Increase MXFLDS to accommodate new Himawari IDs

* Fix index for Himwarai channel 7

* Add Orion and Odin back into build script

* Change lowercase o to uppercase O for orion

* Add Orion and Odin to list of machines

* Save DTC grib2 table and restore develop branch version to be default

Co-authored-by: Kate.Fossell <Kate.Fossell@noaa.gov>
Co-authored-by: Wen Meng <wen.meng@noaa.gov>
Co-authored-by: Tracy <tracy.hertneky@noaa.gov>
Co-authored-by: Michael Kavulich, Jr <michael.kavulich@noaa.gov>
Co-authored-by: kayee <kayee.wong@noaa.gov>
Co-authored-by: Michael Kavulich, Jr <kavulich@ucar.edu>
Co-authored-by: Tracy <hertneky@ucar.edu>
Co-authored-by: Kate Fossell <you@example.com>
Co-authored-by: Dusan Jovic <48258889+DusanJovic-NOAA@users.noreply.github.com>
guoqing-noaa added a commit to guoqing-noaa/UPP that referenced this issue Apr 28, 2022
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

No branches or pull requests

1 participant