CALPUFF 7.3.2 BETA modeling system is now available

A new version of the CALPUFF modeling system was relased October 1, 2019 and updated February 6, 2020. Among the new features is the capability to deal with agricultural spray sources. Moreover, several bugs were corrected, including the known one about precipitation in CALWRF that might cause cumulation of values in 3D.DAT files generated from WRF output files.

Besides CALPUFF (now version 7.3.2 BETA) and CALWRF (now version 2.0.3), the postprocessors CALPOST (now version 7.3.0), CALSUM (now version 7.1.0) and POSTUTIL (now version 7.1.0) were updated.

If you need input data for CALPUFF for any location of the globe, please visit our online modeling service pages.

The CALPUFF 7.3.2 modeling system is available here. In order to recompile the codes with gfortran it may be necessary to make some changes and fixes to the source codes provided, as described below.

CALPUFF-V7.3.1-L171103

Syntax errors in code, fix as shown:

calpuff.for:9278:6:

       !include 'evapdat.puf
       include 'evapdat.puf'  

calpuff.for:57727:6:

       include 'qa.puf's
       include 'qa.puf'  

etime routine must be commented:

calutils.for:2791:
c----------------------------------------------------------------------
!     subroutine etime(rcpu)
c----------------------------------------------------------------------
c
c --- CALUTILS   Version: 7.0.0    Level: 941215                  ETIME
c ---            J. Scire, SRC
c
c --- PURPOSE:  Dummy system CPU time routine for PC
c               DO NOT USE THIS ROUTINE ON SUNs
c
c --- INPUTS:  none
c
c --- OUTPUT:  RCPU  - real - CPU time (sec) -- set to zero for PC
c
c --- ETIME called by:  DATETM
c --- ETIME calls:      none
c----------------------------------------------------------------------
!     rcpu=0.0
c
!     return
!     end

Some non-standard format is used. Change as shown:

calpuff.for:40497 !read(cfver,'(f)') cfdataset read(cfver,*) cfdataset calpuff.for:87592:39: !read(aline320(r1:r2),'(i)') nrddat read(aline320(r1:r2),*) nrddat calpuff.for:87595:39 !read(aline320(r1:r2),'(i)') nrddat read(aline320(r1:r2),*) nrddat

and same error / fix in following read lines.

The ERF and ERFC functions are intrinsic:

calpuff.for:55748:6:
       FUNCTION ERF(XX)
      1
Warning: erf declared at (1) is also the name of an intrinsic.  It can only be called via an explicit interface or if declared EXTERNAL. [-Wintrinsic-shadow]

calpuff.for:55800:

       FUNCTION ERFC(XX)
      1
Warning: erfc declared at (1) is also the name of an intrinsic.  It can only be called via an explicit interface or if declared EXTERNAL. [-Wintrinsic-shadow]

Fix: comment these functions.

Error when running the code:

SETUP PHASE
At line 43682 of file calpuff.for
Fortran runtime error: Index '40' of dimension 2 of array 'cvdic' above upper bound of

Fix: change parameter in file calpuff.puf:

      !parameter(mxsg=39)
      parameter(mxsg=42) 

Error when running the code:

 SETUP PHASE
 COMPUTATIONAL PHASE
   --- Advection Step Starting:
   --- YYYYJJJHH SSSS   # Old  # Emitted

+      201400100    0        0       25
At line 9964 of file calpuff.for
Fortran runtime error: Index '14' of dimension 1 of array 'nsource' above upper bound of 13

The code is:

         nsource(14)=0
         nsource(15)=nsp2

So, at line 9332, change to:

      !integer nsource(13)
      integer nsource(15)

POSTUTIL_v7.1.0-L190930

Error when running the program:

At line 2656 of file calutils.for
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'fmt1' (10/12)
                

Fix: change variables definition in calutils.for

 
calutils:2688 
      !character*12 fmt1,fmt2,sdate
      character*(*) fmt1,fmt2,sdate
               

CALPOST_v7.2.0-L150720

Compilation errors with gfortran:

calutils.for:2791:22:

       subroutine etime(rcpu)
                      1
Warning: etime declared at (1) is also the name of an intrinsic.  It can only be called via an explicit interface or if declared EXTERNAL. [-Wintrinsic-shadow]
calpost.for:14900:36:

             read(line_ver(17:32),'(f)') rver
                                    1
Error: Nonnegative width required in format string at (1)
calpost.for:14903:40:

             read(line_ver((i1+4):32),'(f)') rver
                                        1
Error: Nonnegative width required in format string at (1)
calpost.for:20494:30:

          read(awork2(1:n2),'(i)') irmap(nsamp)
                              1
Error: Nonnegative width required in format string at (1)
                

Fixes:

calutils.for:2791:
c----------------------------------------------------------------------
!     subroutine etime(rcpu)
c----------------------------------------------------------------------
c
c --- CALUTILS   Version: 7.0.0    Level: 941215                  ETIME
c ---            J. Scire, SRC
c
c --- PURPOSE:  Dummy system CPU time routine for PC
c               DO NOT USE THIS ROUTINE ON SUNs
c
c --- INPUTS:  none
c
c --- OUTPUT:  RCPU  - real - CPU time (sec) -- set to zero for PC
c
c --- ETIME called by:  DATETM
c --- ETIME calls:      none
c----------------------------------------------------------------------
!     rcpu=0.0
c
!     return
!     end

calpost.for:14900
c ---       Numeric version field
            !read(line_ver(17:32),'(f)') rver
            read(line_ver(17:32),*) rver
         else
c ---       Numeric field after TNG-
            !read(line_ver((i1+4):32),'(f)') rver
            read(line_ver((i1+4):32),*) rver

calpost.for:20494
         !read(awork2(1:n2),'(i)') irmap(nsamp)
         read(awork2(1:n2),*) irmap(nsamp)

calutils:2688 (this error shows up when running the compiled code)
      !character*12 fmt1,fmt2,sdate
      character*(*) fmt1,fmt2,sdate
                

Errors when running the code:

At line 1104 of file calutils.for
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'cfile' (24/132)

At line 1150 of file calutils.for
Fortran runtime error: Substring out of bounds: upper bound (25) of 'cfile' exceeds string length (24)

Modify filcase subroutine:

      !character*132 cfile
      character*(*) cfile

         !do i=1,132
         do i=1,len(cfile)
            cchar=cfile(i:i)

         !do i=1,132
         do i=1,len(cfile)
            cchar=cfile(i:i)