MCIP FRC_URB2D Variable not Found

Hello,


*** SUBROUTINE: RDWRFEM
*** ERROR RETRIEVING VARIABLE FROM WRF FILE
*** VARIABLE = FRC_URB2D
*** RCODE = NetCDF: Variable not found


Ive looked at the other posts about this but from what I understand the FRC_URB2D variable should be from the FRACTION LAND USE and MCIP says I have those

" FRACTIONAL LAND USE was found in the meteorology input file
FRACTIONAL LAND USE will be read from the GEO file"

MCIP will continue to run with this error until about 3-4 days before the end and then it will quit unexpectedly.

Ive attached the log of the first part of the output.

mcip.txt (77.6 KB)

Hi,
Iā€™ve changed the category to MCIP, so that the developers can respond to this inquiry.
Liz

@sir3nita ā€“

Iā€™m sorry that youā€™ve run into this issue. Iā€™ve modified MCIP a few times to deal with the appropriate data from the urban canopy models in WRF. In your case, it should be OK, because I changed MCIPv4.3 so that the fractional urban data are not required as an output from the urban canopy model, but those data could be used if they were available. (Note that your MCIP run kept going.) I also changed the name of the variable that was expected from WRF to be ā€œFRC_URB2Dā€ instead of ā€œFRC_URBā€ to catch up with another change in WRF.

If you are creating the correct output field from WRF, but itā€™s not being captured correctly in MCIP, please let me know. Admittedly, I do not often use an urban canopy parameterization in WRF, so there may be a variant that I did not consider.

The reason that MCIP is failing after 3-4 days may not be related to this issue at all. It would help if you could attach the full log fileā€¦or at least the last few lines that show the errorā€¦so that we can help you track this down.

ā€“Tanya

Hello,
I got the same error using MCIP5.1 with WRF4.2. New users are not allowed attachments so I paste it down:

Compiler is set to intel
Tue Dec 1 14:32:32 CST 2020

 This program uses the EPA-AREAL/MCNC-EnvPgms/BAMS Models-3      
 I/O Applications Programming Interface, [I/O API] which is      
 built on top of the netCDF I/O library (Copyright 1993, 1996    
 University Corporation for Atmospheric Research/Unidata         
 Program) and the PVM parallel-programming library (from         
 Oak Ridge National Laboratory).  Copyright (C) 1992-2002 MCNC,  
 (C) 1992-2013 Carlie J. Coats, Jr., and (C) 2003-2012 Baron     
 Advanced Meteorological Systems, LLC and released under the     
 GNU LGPL  License, version 2.1.  See URL                        
                                                                 
     https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html     
                                                                 
 for conditions of use.                                          
                                                                 
 ioapi-3.1: $Id:: init3.F 321 2016-02-26 16:00:20Z coats                $
 Version with PARMS3.EXT/PARAMETER::MXVARS3= 2048
 netCDF version "3.6.3" of Sep  4 2017 17:27:22 $
  
  
 EXECUTION_ID: mcip

==============================================================================

              US EPA COMMUNITY MULTISCALE AIR QUALITY MODEL
                METEOROLOGY-CHEMISTRY INTERFACE PROCESSOR

                       MCIP V5.1 FROZEN 11/21/2019

==============================================================================

  • SUBROUTINE SETUP_WRFEM - READING WRF HEADER
    WRF GRID DIMENSIONS (X,Y,Z) 193 169 34

*** SUBROUTINE: SETUP_WRFEM
*** DID NOT FIND FRACTIONAL LAND USE IN wrfout
*** AND DID NOT FIND GEOGRID FILE
*** ā€“ WILL NOT USE FRACTIONAL LAND USE DATA



                    USER OPTIONS AND GRID DEFINITIONS

Output start date = 2020-11-25-00:00:00.0000
Output end date = 2020-11-26-23:00:00.0000
Output interval = 60 minutes

LPV = 0: Will not calculate and output 3D potential vorticity
LWOUT = 0: Will not output vertical velocity from the met model
LUVBOUT = 1: Will output u- and v-component winds on B grid
IOFORM = 2: Will write output in netCDF

LAI was found in the meteorology input file

FRACTIONAL LAND USE was NOT found in the meteorology input file

MONIN-OBUKHOV LENGTH was NOT found in the meteorology input file

MONIN-OBUKHOV LENGTH will NOT be recomputed by MCIP (Only for WRF P-X LSM)

AERODYNAMIC AND STOMATAL RESISTANCE was NOT found in the meteorology input file

2-m TEMPERATURE was found in the meteorology input file

2-m MIXING RATIO was NOT found in the meteorology input file

VEGETATION FRACTION was found in the meteorology input file

10-m WIND was found in the meteorology input file

CANOPY WETNESS was found in the meteorology input file

ROUGHNESS LENGTH was NOT found in the meteorology input file

SOIL MOISTURE, TEMPERATURE, AND TYPE was found in the meteorology input file

SOIL MOISTURE, TEMPERATURE, AND TYPE will be in the output file

TURBULENT KINETIC ENERGY was NOT found in the meteorology input file

URBAN CANOPY MODEL (WRF ONLY) was used in the meteorology model

3D RESOLVED CLOUD FRACTION was found in the meteorology input file

ADDITIONAL PX SURFACE VARIABLES will NOT be in the output file

ADDITIONAL KF-RAD 3D VARIABLES will NOT be in the output file

HYBRID VERTICAL COORDINATE was used in the meteorology model

Met domain dimensions (col, row, lay): 193 169 34
MCIP X domain dimensions (col, row, lay): 192 168 34
Output domain dimensions (col, row, lay): 190 166 34

Output grid resolution: 27.0000000000000 km
Window domain origin on met domain (col,row): 1 , 1
Window domain far corner on met domain (col,row): 193 , 169

Cells and points for diagnostic prints
LPRT_COL LPRT_ROW 95 83
LPRT_XCOL LPRT_XROW 96 84
LPRT_METX LPRT_METY 96 84

IOAPI header variables:
GDTYP3D 2
GDNAM3D d01
P_ALP3D 25.000
P_BET3D 45.000
P_GAM3D 103.000
XCENT3D 103.000
YCENT3D 35.000
XORIG3D -2565000.000
YORIG3D -2241000.000
XCELL3D 27000.000
YCELL3D 27000.000
VGTYP3D -9999
VGTOP3D 10000.000

VGLVS3D   1.00000  0.99300  0.98300  0.97000  0.95400  0.93400
          0.90900  0.88000  0.84500  0.80700  0.76500  0.71900
          0.67200  0.62200  0.57100  0.52000  0.46800  0.42000
          0.37600  0.33500  0.29800  0.26300  0.23100  0.20200
          0.17500  0.15000  0.12700  0.10600  0.08800  0.07000
          0.05500  0.04000  0.02600  0.01300  0.00000

~~~ Processing meteorology for time = 2020-11-25-00:00:00.0000

U 1.4629 1.8227 2.3208 3.0444 3.9115
5.2408 6.9347 8.9822 10.9644 12.5686
13.7844 14.5704 15.0104 15.2277 15.3777
15.6576 16.1806 17.1046 18.5835 20.9006
23.5853 26.0070 28.7148 32.1417 36.3248
41.1399 45.2492 47.7457 48.8961 49.0045
48.0604 46.0754 43.0444 38.9280

V 1.0187 1.2140 1.3621 1.5431 1.8822
2.1677 1.9801 1.3256 0.3474 -0.7305
-1.7151 -2.5688 -3.4638 -4.3957 -4.9884
-4.7919 -3.4608 -1.2034 0.7462 1.0082
0.3812 -1.0508 -3.1854 -4.9382 -5.6033
-4.8036 -3.3361 -1.6314 -0.1414 1.1123
1.9360 2.5360 3.1398 3.6944

W -0.0095 -0.0025 0.0002 0.0006 0.0001
-0.0005 -0.0009 -0.0022 -0.0040 -0.0060
-0.0090 -0.0129 -0.0169 -0.0197 -0.0207
-0.0198 -0.0167 -0.0121 -0.0084 -0.0071
-0.0081 -0.0101 -0.0133 -0.0178 -0.0215
-0.0223 -0.0198 -0.0167 -0.0169 -0.0227
-0.0313 -0.0385 -0.0368 -0.0226 0.0036

PH 0.0000 0.2145 1.8591 6.3965 16.8755
37.7526 75.2870 130.6350 209.3743 304.7816
418.3296 548.6434 685.3320 833.1328 984.0243
1130.4010 1268.8921 1381.9257 1470.0208 1534.7545
1574.0640 1587.2177 1569.0836 1529.1254 1498.3208
1518.4940 1626.9303 1832.5989 2103.2361 2477.1775
2819.6770 3154.2727 3462.2485 3746.2385 4026.3149

PHB 32025.6660 32484.4805 33129.9375 33951.7109 34937.2891
36130.9531 37567.0430 39162.2227 40999.8555 42907.8125
44942.8945 47129.3242 49376.1992 51856.9766 54576.2500
57594.5156 61109.8984 64882.4570 68917.7266 73305.8828
77912.6875 82968.0391 88320.1953 93911.7812 99720.2266
105491.5469 111190.2500 116774.1172 121897.0781 127382.7422
132345.1875 137777.6250 143358.2500 149076.1250 155427.2500

P 1151.5000 1140.5156 1125.4141 1103.9844 1078.1250
1042.3477 996.9883 941.7500 875.9570 800.9805
716.0859 626.0703 532.2188 437.0742 345.0273
258.5703 182.4961 120.9961 72.6992 37.2070
12.6289 -2.6328 -9.2734 -10.4570 -9.5332
-8.4375 -7.3184 -6.1855 -4.9688 -3.9365
-2.9160 -1.8691 -0.9814 -0.1562

PB 66936.9922 66461.5078 65834.0391 65067.6875 64153.4492
63064.2422 61827.1641 60450.3789 58975.9219 57455.6328
55863.3984 54229.4805 52530.6133 50711.8633 48764.6367
46622.0586 44320.4102 41956.3945 39520.5312 37044.0508
34524.1875 31962.3008 29431.6406 26964.7793 24625.0000
22465.0000 20485.0000 18730.0000 17110.0000 15625.0010
14275.0010 12970.0010 11755.0010 10585.0010

T 268.0025 267.9238 267.8543 268.0930 268.5151
269.0180 269.1586 268.8434 268.0318 266.8395
265.2691 263.4612 261.5802 259.4709 256.9356
253.8774 250.4941 247.0735 243.5050 239.7619
235.6738 231.1488 226.8046 223.1966 220.6323
219.3798 218.4359 217.0959 215.4329 213.7677
212.2909 211.0199 209.9256 208.8209

QVAPOR 0.0029 0.0028 0.0028 0.0028 0.0027
0.0026 0.0025 0.0024 0.0023 0.0021
0.0019 0.0017 0.0013 0.0009 0.0006
0.0004 0.0004 0.0003 0.0003 0.0002
0.0001 0.0001 0.0001 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000

QCLOUD 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000

QRAIN 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000

QICE -0.0000 -0.0000 -0.0000 -0.0000 -0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000

QSNOW -0.0000 -0.0000 -0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000

CLDFRA 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000
MU 1110.4401 Pa
MUB 57135.1992 Pa
T2 267.4849 K
U10 -0.0315 m s-1
V10 0.6805 m s-1
PSFC 69068.8047 Pa
MAPFAC_M 0.9848 dimensionless
MAPFAC_U 0.9848 dimensionless
MAPFAC_V 0.9848 dimensionless
HGT 3264.5933 m
RAINC 0.0000 cm
RAINNC 0.0000 cm
SWDOWN 0.0000 W m-2
GLW 195.2915 W m-2
XLAT 34.8766 degrees_north
XLAT_U 34.8763 degrees_north
XLAT_V 34.7533 degrees_north
XLONG 102.8497 degrees_east
XLONG_U 102.6994 degrees_east
XLONG_V 102.8499 degrees_east
LU_INDEX 10 category
LANDMASK 1.0000 category
HFX -0.5285 W m-2
LH 0.0855 W m-2
UST 0.0235 m
PBLH 23.3972 m
LAI 0.6975 m2 m-2
CANWAT 0.0784 kg m-2
VEGFRA 0.1757 fraction
ISLTYP 6 category
SMOIS 1 0.3106 m3 m-3
SMOIS 2 0.2354 m3 m-3

SMOIS 0.3106 0.2354 0.2490 0.2570
TSLB 1 270.9223 K
TSLB 2 274.7204 K

TSLB 270.9223 274.7204 277.7009 279.6491
TSK 266.5821 K
ALBEDO 0.3350 fraction


*** SUBROUTINE: RDWRFEM
*** ERROR RETRIEVING VARIABLE FROM WRF FILE
*** VARIABLE = FRC_URB2D
*** RCODE = NetCDF: Variable not found


SNOWC 0.2045 category
SEAICE 0.0000 fraction
SNOWH 0.0146 m
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
mcip.exe 00000000006D7155 Unknown Unknown Unknown
mcip.exe 00000000006D4D77 Unknown Unknown Unknown
mcip.exe 0000000000676A64 Unknown Unknown Unknown
mcip.exe 0000000000676876 Unknown Unknown Unknown
mcip.exe 0000000000615116 Unknown Unknown Unknown
mcip.exe 0000000000618750 Unknown Unknown Unknown
libpthread.so.0 00000034ED20F710 Unknown Unknown Unknown
mcip.exe 000000000044E159 gridproc_ 51 gridproc.f90
mcip.exe 000000000041060B MAIN__ 165 mcip.f90
mcip.exe 00000000004102DE Unknown Unknown Unknown
libc.so.6 00000034ECE1ED5D Unknown Unknown Unknown
mcip.exe 00000000004101E9 Unknown Unknown Unknown
Error running mcip

Hi!
It looks like MCIP did proceed after it failed to read FRC_URB2D and continued to process other variables. If you rerun MCIP, does it consistently fail at the same point (e.g., right after SNOWH is read in)?

Megan

Yes. It does consistently fail at the same point.

Hello Megan!

After I turn off sf_urban_physics=0 (which generates variable FRC_URB2D) and use physics_suite=ā€˜CONUSā€™ in WRF, MCIP can run without problem.

Yunqing

I see. Thanks for following up about the additional test run. Iā€™d like to get some more information about your original run where MCIP crashed to better understand the problem. Could you post your run_mcip.csh script? Also, please run the following command on one of your wrf output files, substituting your filename for wrfout:
ncdump -h wrfout > out.txt
And post the output.
Thanks,
Megan

Hello Megan!

This is my run_mcip.csh:

#!/bin/csh -f 

#------------------------------------------------------------------------------#
#  The Community Multiscale Air Quality (CMAQ) system software is in           #
#  continuous development by various groups and is based on information        #
#  from these groups: Federal Government employees, contractors working        #
#  within a United States Government contract, and non-Federal sources         #
#  including research institutions.  These groups give the Government          #
#  permission to use, prepare derivative works of, and distribute copies       #
#  of their work in the CMAQ system to the public and to permit others         #
#  to do so.  The United States Environmental Protection Agency                #
#  therefore grants similar permission to use the CMAQ system software,        #
#  but users are requested to provide copies of derivative works or            #
#  products designed to operate in the CMAQ system to the United States        #
#  Government without restrictions as to use by others.  Software              #
#  that is used with the CMAQ system but distributed under the GNU             #
#  General Public License or the GNU Lesser General Public License is          #
#  subject to their copyright restrictions.                                    #
#------------------------------------------------------------------------------#

#=======================================================================
#
#  Script:  run.mcip
#  Purpose: Runs Models-3/CMAQ Meteorology-Chemistry Interface
#           Processor.  Part of the US EPA's Models-3/CMAQ system.
#  Method:  In UNIX/Linux:  run.mcip >&! mcip.log
#  Revised: 20 Sep 2001  Original version.  (T. Otte)
#           18 Oct 2001  Added CoordName to user definitions.  Deleted
#                        script variable DomIdMM5.  Added Fortran link
#                        for GRIDDESC file.  Moved namelist output to
#                        WorkDir, and mmheader output to OutDir.  Added
#                        user variables I0, J0, NCOLS, and NROWS for
#                        MCIP windowing.  (T. Otte)
#           29 Jan 2002  Added new namelist for file names.  Generalized
#                        the end-of-namelist delimiter.  (T. Otte)
#           27 Feb 2002  Removed minimum size for windows.  (T. Otte)
#           19 Mar 2002  Changed default grid cell for printing.
#                        (T. Otte)
#           11 Jun 2003  Clarified instructions on use of BTRIM and
#                        setting I0 and J0 for windowing option.
#                        Removed GRIDBDY2D, GRIDBDY3D, and METBDY2D
#                        from output.  (T. Otte)
#           01 Jul 2004  Restored GRIDBDY2D to output.  (T. Otte)
#           29 Nov 2004  Added TERRAIN option for input to get
#                        fractional land use from MM5 preprocessor.
#                        (T. Otte)
#           26 May 2005  Changed I0 and J0 to Y0 and X0 to make code
#                        more general.  Removed "_G1" from environment
#                        variables for output files.  Created two new
#                        user options for calculating dry deposition
#                        velocities.  Added capability to process more
#                        than five input meteorology files in a single
#                        MCIP run.  (T. Otte)
#           27 Feb 2006  Updated automated namelist generator for
#                        Linux on Mac (assumed to be) using the XLF
#                        compiler.  (T. Otte)
#           24 Jul 2007  Added option to bypass dry deposition velocity
#                        calculations in MCIP so that they can be done
#                        inline in the CCTM.  Eliminated options to
#                        use RADM (Wesely) dry deposition, eliminated
#                        multiple versions of M3Dry (Pleim) dry
#                        deposition, and eliminated options and to
#                        recalculate PBL and radiation fields in MCIP.
#                        (T. Otte)
#           27 May 2008  Added optional namelist variable to override
#                        earth radius default from MM5 and WRF.  
#                        (T. Otte)
#                        Added variables to support GOES satellite
#                        cloud processing (InSatDir, InSatFile, LSAT).
#                        Requires additional data and preprocessing
#                        package available from University of Alabama
#                        at Huntsville.  Contributed by University of
#                        Alabama at Huntsville.  (A. Biazar and T. Otte)
#           23 Dec 2008  Added optional namelist variable to override
#                        default setting for reference latitude for
#                        WRF Lambert conformal projection.  (T. Otte)
#           19 Mar 2010  Added namelist variable option to compute
#                        and output potential vorticity.  Added namelist
#                        variable option to output vertical velocity
#                        predicted by meteorological model.  Allow
#                        output from WRF Preprocessing System (WPS)
#                        routine, GEOGRID, to provide fractional land
#                        use output if it is unavailable in WRF output.
#                        Add user option to output u- and v-component
#                        winds on C-staggered grid.  (T. Otte)
#           09 Sep 2010  Removed option to generate dry deposition
#                        velocities in MCIP.  (T. Otte)
#           07 Sep 2011  Corrected minor typos in error-checking (as
#                        identified by Debra Baker, Univ. of Maryland).
#                        Updated disclaimer.  (T. Otte)
#           31 May 2012  Changed comment about MAX_MM to be consistent
#                        with the change to the code.  (T. Otte)
#           16 Mar 2018  Added new optional output files for land use,
#                        soil, and mosaic output.  Now delete rather
#                        than overwrite existing MCIP output files.
#                        (T. Spero)
#           18 Dec 2018  Removed support for MM5v3 input.  Added runtime
#                        option to choose output format.  Removed option
#                        to turn off static output.  (T. Spero)
#           20 Jun 2019  Removed layer collapsing.  Changed LUVCOUT to
#                        to LUVBOUT to make the default output for
#                        u- and v-component winds on the Arakawa-C
#                        staggering.  The Arakawa-B staggering is now
#                        optional (additional fields), and the Arakawa-C
#                        staggering is the default.  (T. Spero)
#           17 Nov 2019  Corrected variable setting for file_geo in
#                        namelist generation code.  (T. Spero)
#=======================================================================

#-----------------------------------------------------------------------
# Set identification for input and output files.
#
#   APPL       = Application Name (tag for MCIP output file names)
#   CoordName  = Coordinate system name for GRIDDESC
#   GridName   = Grid Name descriptor for GRIDDESC
#   InMetDir   = Directory that contains input meteorology files
#   InGeoDir   = Directory that contains input WRF "GEOGRID" file to
#                provide fractional land-use categories if "LANDUSEF"
#                was not included in the WRFOUT files.
#   OutDir     = Directory to write MCIP output files
#   ProgDir    = Directory that contains the MCIP executable
#   WorkDir    = Working Directory for Fortran links and namelist
#-----------------------------------------------------------------------

source /home/caoyq/CMAQ-5.3.2/config_cmaq.csh intel

set APPL       = 2020-12-02
set CoordName  = LamCon_35N_103E   # 16-character maximum
set GridName   = d01               # 16-character maximum

set DataPath   = 
set InMetDir   = /home/caoyq/wrf/wrfout/2020-12-01
set InGeoDir   = /home/caoyq/wrf/WPS-4.2
set OutDir     = .
set ProgDir    = ../src
set WorkDir    = .

#-----------------------------------------------------------------------
# Set name(s) of input meteorology file(s)
#
#   File name(s) must be set inside parentheses since "InMetFiles" is
#   a C-shell script array.  Multiple file names should be space-
#   delimited.  Additional lines can be used when separated by a
#   back-slash (\) continuation marker.  The file names can be as
#   they appear on your system; MCIP will link the files in by a
#   Fortran unit number and the explicit name via a namelist.  The
#   files must be listed in chronological order.  The maximum number
#   of input meteorology files must be less than or equal to the number
#   in MAX_MM in file_mod.F (default is 367).
#
#   Example:
#     set InMetFiles = ( $InMetDir/wrfout_d01_date1 \
#                        $InMetDir/wrfout_d01_date2 )
#
#-----------------------------------------------------------------------

set InMetFiles = ( $InMetDir/wrfout_${GridName}_2020-12-01_00:00:00 \
                   $InMetDir/wrfout_${GridName}_2020-12-02_00:00:00 \
                   $InMetDir/wrfout_${GridName}_2020-12-03_00:00:00 )

set IfGeo      = "F"
set InGeoFile  = $InGeoDir/geo_em.${GridName}.nc

#-----------------------------------------------------------------------
# Set user control options.
#
#   LPV:     0 = Do not compute and output potential vorticity
#            1 = Compute and output potential vorticity
#
#   LWOUT:   0 = Do not output vertical velocity
#            1 = Output vertical velocity
#
#   LUVBOUT: 0 = Do not output u- and v-component winds on B-grid
#            1 = Output u- and v-component winds on B-grid (cell corner)
#                in addition to the C-grid (cell face) output
#-----------------------------------------------------------------------

set LPV     = 0
set LWOUT   = 0
set LUVBOUT = 1

#-----------------------------------------------------------------------
# Set run start and end date.  (YYYY-MO-DD-HH:MI:SS.SSSS)
#   MCIP_START:  First date and time to be output [UTC]
#   MCIP_END:    Last date and time to be output  [UTC]
#   INTVL:       Frequency of output [minutes]
#-----------------------------------------------------------------------

set MCIP_START = 2020-12-02-00:00:00.0000  # [UTC]
set MCIP_END   = 2020-12-03-23:00:00.0000  # [UTC]

set INTVL      = 60 # [min]

#-----------------------------------------------------------------------
# Choose output format.
#   1 = Models-3 I/O API
#   2 = netCDF
#-----------------------------------------------------------------------

set IOFORM = 1

#-----------------------------------------------------------------------
# Set number of meteorology "boundary" points to remove on each of four
# horizontal sides of MCIP domain.  This affects the output MCIP domain
# dimensions by reducing meteorology domain by 2*BTRIM + 2*NTHIK + 1,
# where NTHIK is the lateral boundary thickness (in BDY files), and the
# extra point reflects conversion from grid points (dot points) to grid
# cells (cross points).  Setting BTRIM = 0 will use maximum of input
# meteorology.  To remove MM5 lateral boundaries, set BTRIM = 5.
#
# *** If windowing a specific subset domain of input meteorology, set
#     BTRIM = -1, and BTRIM will be ignored in favor of specific window
#     information in X0, Y0, NCOLS, and NROWS.
#-----------------------------------------------------------------------

set BTRIM = 0

#-----------------------------------------------------------------------
# Define MCIP subset domain.  (Only used if BTRIM = -1.  Otherwise,
# the following variables will be set automatically from BTRIM and
# size of input meteorology fields.)
#   X0:     X-coordinate of lower-left corner of full MCIP "X" domain
#           (including MCIP lateral boundary) based on input MM5 domain.
#           X0 refers to the east-west dimension.  Minimum value is 1.
#   Y0:     Y-coordinate of lower-left corner of full MCIP "X" domain
#           (including MCIP lateral boundary) based on input MM5 domain.
#           Y0 refers to the north-south dimension.  Minimum value is 1.
#   NCOLS:  Number of columns in output MCIP domain (excluding MCIP
#           lateral boundaries).
#   NROWS:  Number of rows in output MCIP domain (excluding MCIP
#           lateral boundaries).
#-----------------------------------------------------------------------

set X0    =  13
set Y0    =  94
set NCOLS =  89
set NROWS = 104

#-----------------------------------------------------------------------
# Set coordinates for cell for diagnostic prints on output domain.
# If coordinate is set to 0, domain center cell will be used.
#-----------------------------------------------------------------------

set LPRT_COL = 0
set LPRT_ROW = 0

#-----------------------------------------------------------------------
# Optional:  Set WRF Lambert conformal reference latitude.
#            (Handy for matching WRF grids to existing MM5 grids.)
#            If not set, MCIP will use average of two true latitudes.
# To "unset" this variable, set the script variable to "-999.0".
# Alternatively, if the script variable is removed here, remove it
# from the setting of the namelist (toward the end of the script).
#-----------------------------------------------------------------------

set WRF_LC_REF_LAT = 35.0

#=======================================================================
#=======================================================================
# Set up and run MCIP.
#   Should not need to change anything below here.
#=======================================================================
#=======================================================================

set PROG = mcip

date

#-----------------------------------------------------------------------
# Make sure directories exist.
#-----------------------------------------------------------------------

if ( ! -d $InMetDir ) then
  echo "No such input directory $InMetDir"
  exit 1
endif

if ( ! -d $OutDir ) then
  echo "No such output directory...will try to create one"
  mkdir -p $OutDir
  if ( $status != 0 ) then
    echo "Failed to make output directory, $OutDir"
    exit 1
  endif
endif

if ( ! -d $ProgDir ) then
  echo "No such program directory $ProgDir"
  exit 1
endif

#-----------------------------------------------------------------------
# Make sure the input files exist.
#-----------------------------------------------------------------------

if ( $IfGeo == "T" ) then
  if ( ! -f $InGeoFile ) then
    echo "No such input file $InGeoFile"
    exit 1
  endif
endif

foreach fil ( $InMetFiles )
  if ( ! -f $fil ) then
    echo "No such input file $fil"
    exit 1
  endif
end

#-----------------------------------------------------------------------
# Make sure the executable exists.
#-----------------------------------------------------------------------

if ( ! -f $ProgDir/${PROG}.exe ) then
  echo "Could not find ${PROG}.exe"
  exit 1
endif

#-----------------------------------------------------------------------
# Create a work directory for this job.
#-----------------------------------------------------------------------

if ( ! -d $WorkDir ) then
  mkdir -p $WorkDir
  if ( $status != 0 ) then
    echo "Failed to make work directory, $WorkDir"
    exit 1
  endif
endif

cd $WorkDir

#-----------------------------------------------------------------------
# Set up script variables for input files.
#-----------------------------------------------------------------------

if ( $IfGeo == "T" ) then
  if ( -f $InGeoFile ) then
    set InGeo = $InGeoFile
  else
    set InGeo = "no_file"
  endif
else
  set InGeo = "no_file"
endif

set FILE_GD  = $OutDir/GRIDDESC

#-----------------------------------------------------------------------
# Create namelist with user definitions.
#-----------------------------------------------------------------------

set MACHTYPE = `uname`
if ( ( $MACHTYPE == "AIX" ) || ( $MACHTYPE == "Darwin" ) ) then
  set Marker = "/"
else
  set Marker = "&END"
endif

cat > $WorkDir/namelist.${PROG} << !

 &FILENAMES
  file_gd    = "$FILE_GD"
  file_mm    = "$InMetFiles[1]",
!

if ( $#InMetFiles > 1 ) then
  @ nn = 2
  while ( $nn <= $#InMetFiles )
    cat >> $WorkDir/namelist.${PROG} << !
               "$InMetFiles[$nn]",
!
    @ nn ++
  end
endif

if ( $IfGeo == "T" ) then
cat >> $WorkDir/namelist.${PROG} << !
  file_geo   = "$InGeo"
!
endif

cat >> $WorkDir/namelist.${PROG} << !
  ioform     =  $IOFORM
 $Marker

 &USERDEFS
  lpv        =  $LPV
  lwout      =  $LWOUT
  luvbout    =  $LUVBOUT
  mcip_start = "$MCIP_START"
  mcip_end   = "$MCIP_END"
  intvl      =  $INTVL
  coordnam   = "$CoordName"
  grdnam     = "$GridName"
  btrim      =  $BTRIM
  lprt_col   =  $LPRT_COL
  lprt_row   =  $LPRT_ROW
  wrf_lc_ref_lat = $WRF_LC_REF_LAT
 $Marker

 &WINDOWDEFS
  x0         =  $X0
  y0         =  $Y0
  ncolsin    =  $NCOLS
  nrowsin    =  $NROWS
 $Marker

!

#-----------------------------------------------------------------------
# Set links to FORTRAN units.
#-----------------------------------------------------------------------

rm fort.*
if ( -f $FILE_GD ) rm -f $FILE_GD

ln -s $FILE_GD                   fort.4
ln -s $WorkDir/namelist.${PROG}  fort.8

set NUMFIL = 0
foreach fil ( $InMetFiles )
  @ NN = $NUMFIL + 10
  ln -s $fil fort.$NN
  @ NUMFIL ++
end

#-----------------------------------------------------------------------
# Set output file names and other miscellaneous environment variables.
#-----------------------------------------------------------------------

setenv IOAPI_CHECK_HEADERS  T
setenv EXECUTION_ID         $PROG

setenv GRID_BDY_2D          $OutDir/GRIDBDY2D_${APPL}.nc
setenv GRID_CRO_2D          $OutDir/GRIDCRO2D_${APPL}.nc
setenv GRID_DOT_2D          $OutDir/GRIDDOT2D_${APPL}.nc
setenv MET_BDY_3D           $OutDir/METBDY3D_${APPL}.nc
setenv MET_CRO_2D           $OutDir/METCRO2D_${APPL}.nc
setenv MET_CRO_3D           $OutDir/METCRO3D_${APPL}.nc
setenv MET_DOT_3D           $OutDir/METDOT3D_${APPL}.nc
setenv LUFRAC_CRO           $OutDir/LUFRAC_CRO_${APPL}.nc
setenv SOI_CRO              $OutDir/SOI_CRO_${APPL}.nc
setenv MOSAIC_CRO           $OutDir/MOSAIC_CRO_${APPL}.nc

if ( -f $GRID_BDY_2D ) rm -f $GRID_BDY_2D
if ( -f $GRID_CRO_2D ) rm -f $GRID_CRO_2D
if ( -f $GRID_DOT_2D ) rm -f $GRID_DOT_2D
if ( -f $MET_BDY_3D  ) rm -f $MET_BDY_3D
if ( -f $MET_CRO_2D  ) rm -f $MET_CRO_2D
if ( -f $MET_CRO_3D  ) rm -f $MET_CRO_3D
if ( -f $MET_DOT_3D  ) rm -f $MET_DOT_3D
if ( -f $LUFRAC_CRO  ) rm -f $LUFRAC_CRO
if ( -f $SOI_CRO     ) rm -f $SOI_CRO
if ( -f $MOSAIC_CRO  ) rm -f $MOSAIC_CRO

if ( -f $OutDir/mcip.nc      ) rm -f $OutDir/mcip.nc
if ( -f $OutDir/mcip_bdy.nc  ) rm -f $OutDir/mcip_bdy.nc

#-----------------------------------------------------------------------
# Execute MCIP.
#-----------------------------------------------------------------------

$ProgDir/${PROG}.exe

if ( $status == 0 ) then
  rm fort.*
  exit 0
else
  echo "Error running $PROG"
  exit 1
endif

out.txt (49.1 KB) ,out_no_urban.txt (50.8 KB) ,
out.txt is WRF with sf_urban_physics, out_no_urban is not. Note that my WRF was initialised with GFS data.

Hello Megan!
Thanks for your reply, I didnā€™t notice that IfGeo was set to ā€˜Fā€™ by defalut which cause this problem.
After I set to ā€˜Tā€™, mcip can run without any problem.
Yunqing

Hi,
Iā€™m glad to know you were able to get your run to go forward. I think MCIP is supposed to proceed with the run even if the geogrid file is missing, so Iā€™ll continue to look at this use case to see if a fix needs to be applied.
Thanks,
Megan

1 Like