New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 9298 for branches/NERC/dev_r5518_GO6_CO2_cmip/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90 – NEMO

Ignore:
Timestamp:
2018-02-01T12:58:33+01:00 (6 years ago)
Author:
jpalmier
Message:

JPALM -- correct the CO2 interpolation for ocean-only; atm CO2 read from file in ocean-only whatever record length; report corrctly what is read in ocean.output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5518_GO6_CO2_cmip/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90

    r9285 r9298  
    497497      !! ** Method  : - Read the xco2 file 
    498498      !!---------------------------------------------------------------------- 
    499       INTEGER  ::  jn, jl, jm, io, ierr, inum 
     499      INTEGER  ::  jn, jm, io, ierr, inum 
    500500      INTEGER  ::  iskip = 4   ! number of 1st descriptor lines 
    501       REAL(wp) ::  zyy 
     501      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)   ::   zyy !: xCO2 record years 
    502502      CHARACTER (len=10) ::   clname = 'xco2.atm'  !! atm CO2 record file 
    503503      !!---------------------------------------------------------------------- 
     
    525525      !                                ! Allocate CO2 hist arrays 
    526526      ierr = 0  
    527       ALLOCATE( hist_pco2(co2_rec), STAT=ierr ) 
     527      ALLOCATE( hist_pco2(co2_rec),zyy(co2_rec), STAT=ierr ) 
    528528      IF( ierr > 0 ) THEN 
    529529         CALL ctl_stop( 'trc_ini_medusa_co2atm: unable to allocate  array' )   ; RETURN 
     
    540540      jn = 1 
    541541      DO 
    542         READ(inum,*, IOSTAT=io) zyy, hist_pco2(jn) 
     542        READ(inum,*, IOSTAT=io) zyy(jn), hist_pco2(jn) 
    543543        IF( io < 0 ) exit 
    544         IF(jn==1) co2_yinit = int(zyy) 
     544        IF(jn==1) co2_yinit = zyy(jn) 
    545545        jn = jn + 1 
    546546      END DO 
    547       co2_yend = co2_yinit + co2_rec - 1 
     547      co2_yend = co2_yinit + real(co2_rec) - 1. 
    548548 
    549549      IF(lwp) THEN        ! Control print 
     
    553553         WRITE(numout,*) ' Year   xCO2 atm ' 
    554554         DO jn = 1, co2_rec 
    555             jl = jn + co2_yinit - 1 
    556             WRITE(numout, '( 1I4, 6F9.2)') jl, hist_pco2(jn) 
     555            WRITE(numout, '( 5F7.1, 6F9.2)') zyy(jn), hist_pco2(jn) 
    557556         END DO 
    558557      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.