** Warning **

Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle dbname=MITgcm at /usr/local/share/lxr/lib/LXR/Common.pm line 1224.

Last-Modified: Sat, 17 May 2024 05:11:26 GMT Content-Type: text/html; charset=utf-8 MITgcm/MITgcm/pkg/fizhi/fizhi_readparms.F
Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:40:22 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
a456aa407c Andr*0001 #include "FIZHI_OPTIONS.h"
4ef02e4efb Ed H*0002 
                0003 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0004 CBOP 0
                0005 C     !ROUTINE: FIZHI_MNC_INIT
                0006 
                0007 C     !INTERFACE:
                0008       SUBROUTINE FIZHI_READPARMS( myThid )
                0009 
                0010 C     !DESCRIPTION:
                0011 C     Read Fizhi Namelist and Get the Model Date and Time from File
                0012 
                0013 C     !USES:
2b01b47588 Andr*0014       implicit none
                0015 
                0016 #include "chronos.h"
5ca09be2c5 Andr*0017 #include "SIZE.h"
                0018 #include "fizhi_ocean_coms.h"
4ef02e4efb Ed H*0019 #include "fizhi_io_comms.h"
2b01b47588 Andr*0020 #include "EEPARAMS.h"
49e89eefb2 Andr*0021 #include "PARAMS.h"
2b01b47588 Andr*0022 
4ef02e4efb Ed H*0023 C     !INPUT PARAMETERS:
2b01b47588 Andr*0024       integer myThid
4ef02e4efb Ed H*0025 CEOP
2b01b47588 Andr*0026 
4ef02e4efb Ed H*0027 C     !LOCAL VARIABLES:
2b01b47588 Andr*0028       character*(MAX_LEN_MBUF) msgBuf
615a167388 Andr*0029       integer ku, ku2
2b01b47588 Andr*0030       integer nymdbegin, nhmsbegin
                0031       integer nymdcurrent, nhmscurrent
49e89eefb2 Andr*0032       real runlength
615a167388 Andr*0033       integer  nincr
                0034       integer mmdd,hhmmss,nsecf2
1c45378270 Andr*0035       integer nymdend,nhmsend
c189220968 Andr*0036       logical climsst, climsice
2b01b47588 Andr*0037 
920a6107ff Jean*0038       namelist / fizhi_list /
                0039      &     nymdbegin, nhmsbegin,
                0040      &     fizhi_mnc_write_pickup, fizhi_mnc_read_pickup,
                0041      &     runlength, climsst, climsice
                0042 
                0043 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0044 
                0045       IF ( .NOT.useFizhi ) THEN
                0046 C-    pkg FIZHI is not used
                0047         _BEGIN_MASTER(myThid)
                0048 C-    Track pkg activation status:
                0049 C     print a (weak) warning if data.fizhi is found
                0050          CALL PACKAGES_UNUSED_MSG( 'useFizhi', ' ', ' ' )
                0051         _END_MASTER(myThid)
                0052         RETURN
                0053       ENDIF
2b01b47588 Andr*0054 
4ef02e4efb Ed H*0055 C     Set defaults
840f2b37b4 Andr*0056       fizhi_mdsio_read_pickup = .TRUE.
                0057       fizhi_mdsio_write_pickup = .TRUE.
                0058       fizhi_mnc_write_pickup = .FALSE.
                0059       fizhi_mnc_read_pickup = .FALSE.
49e89eefb2 Andr*0060       runlength = 0.0
c189220968 Andr*0061       climsst = .TRUE.
                0062       climsice = .TRUE.
2b01b47588 Andr*0063 
4ef02e4efb Ed H*0064 C     Read Fizhi Namelist
2b01b47588 Andr*0065       WRITE(msgBuf,'(A)') ' FIZHI_READPARMS: opening data.fizhi'
                0066       CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,SQUEEZE_RIGHT,1)
                0067 
                0068       CALL OPEN_COPY_DATA_FILE('data.fizhi', 'FIZHI_READPARMS',
4ef02e4efb Ed H*0069      &     ku,myThid )
2b01b47588 Andr*0070       read  (ku,NML=fizhi_list)
7a77863887 Mart*0071 #ifdef SINGLE_DISK_IO
                0072       CLOSE(ku)
                0073 #else
                0074       CLOSE(ku,STATUS='DELETE')
                0075 #endif /* SINGLE_DISK_IO */
2b01b47588 Andr*0076 
4ef02e4efb Ed H*0077 C     Read Supplemental Ascii File with Current Time Info
615a167388 Andr*0078       CALL MDSFINDUNIT( ku2, myThid )
                0079       open(ku2,file='datetime0',form='formatted')
                0080       read(ku2,1000)nymdcurrent,nhmscurrent
                0081       close (ku2)
2b01b47588 Andr*0082  1000 format(i8,2x,i6)
                0083 
615a167388 Andr*0084 C Change the length of the model run, ie, change ntimesteps
                0085 C  if runlength has been set in the fizhi namelist
                0086 
                0087       if(runlength.gt.0.) then
                0088        mmdd = int(runlength)
                0089        hhmmss = int((runlength - int(runlength))*1.e6)
7a868e24cb Andr*0090        if(mmdd.lt.100) then
1c45378270 Andr*0091         nincr = nsecf2(hhmmss,mmdd,nymdcurrent)
                0092        else
                0093         call time2freq2(mmdd,nymdcurrent,nhmscurrent,nincr)
                0094        endif
bb3ab34e24 Jean*0095        nTimeSteps = int(nincr/deltaT)
                0096        nEndIter = nIter0 + nTimeSteps
                0097        endTime = startTime + deltaT*float(nTimeSteps)
920a6107ff Jean*0098        WRITE(msgBuf,'(A,I10)')
                0099      &         ' CHANGING NUMBER OF MODEL TIMESTEPS TO',ntimesteps
615a167388 Andr*0100        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,SQUEEZE_RIGHT,1)
a2a5a9e31c Andr*0101        WRITE(msgBuf,'(A,F12.2)') ' CHANGING END TIME TO',endtime
5ecfb4dc04 Andr*0102        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,SQUEEZE_RIGHT,1)
615a167388 Andr*0103       endif
                0104 
4ef02e4efb Ed H*0105 C     Fill chronos Common Block with Namelist and Other File Info
2b01b47588 Andr*0106       nymd0 = nymdbegin
                0107       nhms0 = nhmsbegin
                0108       nymd = nymdcurrent
                0109       nhms = nhmscurrent
                0110 
c189220968 Andr*0111 C     Fill ocean params common block with namelist into
                0112       sstclim = climsst
                0113       siceclim = climsice
                0114 
4ef02e4efb Ed H*0115 C     Echo Date and Time Info
68d0aa1535 Andr*0116       _BEGIN_MASTER(myThid)
2b01b47588 Andr*0117       print *, '  Begin Date ',nymd0,'   Begin Time ',nhms0
                0118       print *, 'Current Date ',nymd,' Current Time ',nhms
                0119       _END_MASTER(myThid)
                0120 
                0121       return
                0122       end