============================================================== Code modifications/bug fix to run NESTED_CH simulation at the 0.25x0.3125 resolution. Based on the public release standard version of v9-02 Codes and Data can be found at the following ftp site: ftp://166.111.42.70/share/v9-02_CH025/ yuyao, yxw@tsinghua, 10/26/2014 =============================================================== 1. CMN_SIZE_mod.F There exits a grammar fault in 025 x 03125 NESTED_CH definition. before: #elif defined( GEOS_FP ) && defined( GRID025x03125 ) && defined( NESTED_CH ) !----------------------------------------------------------------- ! GEOS-FP: Nested China Grid !----------------------------------------------------------------- INTEGER :: IGLOB = 225 INTEGER :: JGLOB = 161 INTEGER :: LGLOB = 72 INTEGER :: IIPAR = IGLOB INTEGER :: JJPAR = JGLOB ------------------------------------------------------------------ after: #elif defined( GEOS_FP ) && defined( GRID025x03125 ) && defined( NESTED_CH ) !----------------------------------------------------------------- ! GEOS-FP: Nested China Grid !----------------------------------------------------------------- INTEGER :: IGLOB = 225 INTEGER :: JGLOB = 161 INTEGER :: LGLOB = 72 INTEGER :: IIPAR INTEGER :: JJPAR ------------------------------------------------------------------ 2. geia_mod.F For the 025x03125 nested-CH grid, TODN (scale factor for time of day) is not defined in geia_mod.F for the 025x03125 NESTED simulation, which result in zero anthropogenic emission for CO and hydrocarbons in emfossil.F. The following lines are added from line 445 in geia_mod.F to compute the TODX for 025x03125 grid. Note the MELD025x03125 files is simply renamed from the MELD05x0667 file; no regridding is needed. ========================================================================== elif defined( GRID025x03125 ) ! Define the file name FILENAME = TRIM( DATA_DIR ) // 'fossil_200104/MELD025x03125' WRITE( 6, 100 ) TRIM( FILENAME ) 100 FORMAT( 'READ_TODX: Reading: ', a ) ! Open the 05x0666 file OPEN( IUNIT, FILE=TRIM( FILENAME ), STATUS='OLD', & FORM='FORMATTED', IOSTAT=IOS ) IF ( IOS /= 0 ) CALL IOERROR( IOS, IUNIT, 'read_todx:5' ) ! Read time-of-day scale factors READ( IUNIT, '(6E12.4)', IOSTAT=IOS ) TODN, TODH, TODB IF ( IOS /= 0 ) CALL IOERROR( IOS, IUNIT, 'read_todx:6' ) ! Read Weekday/Saturday/Sunday emission scale factors READ( IUNIT, '(3F7.4)', IOSTAT=IOS ) & ( ( SCNR89(I,J), J=1,3 ), I=1,3 ) IF ( IOS /= 0 ) CALL IOERROR( IOS, IUNIT, 'read_todx:7' ) ! Close the file CLOSE( IUNIT ) #endif =========================================================================== 3.lightning_nox_mod.F Add the average annual flash rate (flashes per second) of NESTED CHINA at 0.25 x 0.3125 resolution in line 1513. -------------------------------------------------------------------- #elif defined( GRID025x03125 ) && defined( NESTED_CH ) REAL*8, PARAMETER :: ANN_AVG_FLASHRATE = 4.6591586d0 #endif -------------------------------------------------------------------- Also,add the following moduel for counting the lightning flash rate of nested china at 0.25x0.3125 resolution in line 1587. --------------------------------------------------------------------------- #elif defined( GEOS_FP ) && defined( GRID025x0325 ) && defined( NESTED_CH ) !--------------------------------------- ! GEOS-FP: Nested China simulation !--------------------------------------- ! Constrained with simulated "climatology" for ! Jan 2013 - Dec 2013. Will need to be updated as more ! met fields become available (ltm, 10/22/14). IF ( ( GET_YEAR() .eq. 2013 .and. GET_MONTH() .ge. 1 ) .or. & ( GET_YEAR() .eq. 2013 .and. GET_MONTH() .le. 12 ) ) THEN BETA = ANN_AVG_FLASHRATE / 1052.6366d0 ENDIF ----------------------------------------------------------------------------- we have updated the lightning_nox_mod.F with the help of Lee Murray. 4. input.geos file ***The simulation menu********* Global offsets I0, J0 : 800 420 the global offsets for 025x03125 grid china should be set to 800 420 , this computed according to the grid. ================================================================================================== The following bug informations relate to the parallel computing problem. Depending on your computation platform, you may not have these problems. We list them here for reference purposes. ================================================================================================== 4. vdiff_mod.F90 This is a not a grammar problem , but a parallel computing problem,in line 2527. On one platform at Tsinghua U, we need to cancel the parallel computing in the following lines to get the code running. ======================================================================= !$OMP PARALLEL DO DEFAULT( SHARED ) & !$OMP PRIVATE( J ) do J = 1, JJPAR call vdiff( J, 1, p_um1, p_vm1, & p_tadv, p_pmid, p_pint, p_rpdel, & p_rpdeli, dtime, p_zm, p_hflux, & sflx, p_thp, p_as2, pblh, & p_kvh, p_kvm, tpert, qpert, & p_cgs, p_shp, shflx, IIPAR, & State_Met, ustar_arg=p_ustar ) enddo !$OMP END PARALLEL DO ====================================================================== we need to cancel the parallel computing by adding '!' on the OMP function lines. 5. transport_mod.F90 This is a parallel computing problem when running 2 x 2.5. On one platform at Tsinghua U, we need to cancel the OMP parallel function by adding a '!' on the function lines. ====================================================================== !$OMP PARALLEL DO !$OMP+DEFAULT( SHARED ) !$OMP+PRIVATE( I, J, L, N, SUMADA, AD_A, TR_A, TR_DIFF ) DO N = 1, N_TOT_TRC ! Zero summing variable SUMADA = 0.d0 DO L = 1, LLPAR DO J = 1, JJPAR DO I = 1, IIPAR ! Air mass [kg] after transport AD_A(I,J,L) = GET_AIR_MASS( I, J, L, P_TP2(I,J) ) ! Tracer mass [kg] after transport TR_A(I,J,L) = State_Chm%Tracers(I,J,L,N) & * AD_A(I,J,L) & / TCVV(N) IF ( State_Chm%Tracers(I,J,L,N) > 0.d0 .or. & State_Chm%Tracers(I,J,L,N) < 0.d0 ) THEN SUMADA = SUMADA + AD_A(I,J,L) ENDIF ENDDO ENDDO ENDDO ! Residual mass difference [kg]: before - after TR_DIFF = SUM( TR_B(:,:,:,N) ) - SUM( TR_A ) ! Convert from [kg] to [v/v] TR_DIFF = SAFE_DIV(TR_DIFF, SUMADA, 0.d0) * TCVV(N) ! Add mass difference [v/v] back to STT DO L = 1, LLPAR DO J = 1, JJPAR DO I = 1, IIPAR IF ( State_Chm%Tracers(I,J,L,N) > 0.d0 .or. & State_Chm%Tracers(I,J,L,N) < 0.d0 ) THEN State_Chm%Tracers(I,J,L,N) = & State_Chm%Tracers(I,J,L,N) + TR_DIFF ENDIF State_Chm%Tracers(I,J,L,N) = & MAX( State_Chm%Tracers(I,J,L,N), 0d0 ) ENDDO ENDDO ENDDO ENDDO !$OMP END PARALLEL DO ================================================================= tpcore_fvdas_mod.F90 have met the same problem in Tpcore_FvDas subroutine. On one platform at Tsinghua U, we need to cancel the parallel function from line 744 to 1093 in tpcore_fvdas_mod.F90 6.strat_chem_mod.F90 This is also a parallel computing problem we met in running 025x03125 nested simulation with linoz for O3. On one platform at Tsinghua U, we need to cancel the parallel computing in line 456 and 525 in strat_chem_mod.F90