Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:45:23 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
7ae8fb32b5 Andr*0001 #include "FIZHI_OPTIONS.h"
e3d1bbfdf6 Jean*0002        SUBROUTINE FIZHI_INIT_FIXED (myThid)
7ae8fb32b5 Andr*0003 c-----------------------------------------------------------------------
                0004 c  Routine to initialise the fizhi package.
e3d1bbfdf6 Jean*0005 c
7ae8fb32b5 Andr*0006 c  Input: myThid       - Process number calling this routine
                0007 c
e3d1bbfdf6 Jean*0008 c  Notes:
7ae8fb32b5 Andr*0009 c   1) This routine is the interface to read input datasets and set
                0010 c      other fixed variables for fizhi
                0011 c      the datasets are:
                0012 c         vegetation (data for each tile at every grid point)
                0013 c         ozone (varies with lat, height and time - read it all in
                0014 c                   now and interpolate between values later)
                0015 c      the other fixed parameters are:
                0016 c         N2O, Methane (vary with space)
                0017 c         CO2, CFC11, CFC12, CFC22 (set to a global value)
                0018 c   3) For now, the fizhi package contains the alarms and clocks
                0019 c      routines, so this routine will also initialize the alarms.
                0020 c-----------------------------------------------------------------------
e3d1bbfdf6 Jean*0021        IMPLICIT NONE
7ae8fb32b5 Andr*0022 #include "SIZE.h"
                0023 #include "fizhi_SIZE.h"
                0024 #include "fizhi_land_SIZE.h"
                0025 #include "EEPARAMS.h"
                0026 #include "fizhi_chemistry_coms.h"
                0027 #include "fizhi_earth_coms.h"
                0028 #include "fizhi_land_coms.h"
                0029 #include "fizhi_ocean_coms.h"
                0030 #include "chronos.h"
                0031 #include "gridalt_mapping.h"
                0032 #include "GRID.h"
                0033 #include "PARAMS.h"
                0034 
e3d1bbfdf6 Jean*0035        INTEGER myThid
7ae8fb32b5 Andr*0036 
e3d1bbfdf6 Jean*0037        INTEGER i,j,L,bi,bj
                0038        INTEGER im1, im2, jm1, jm2, idim2, jdim2
                0039        INTEGER nymdb,nhmsb
                0040        CHARACTER*40 vegdata
7ae8fb32b5 Andr*0041        _RL pressure0(Nrphys+1)
                0042        _RL pressure(Nrphys)
e3d1bbfdf6 Jean*0043        _RL lats(sNx,sNy,nSx,nSy), lons(sNx,sNy,nSx,nSy)
                0044        _RL fracland(sNx,sNy,nSx,nSy)
7ae8fb32b5 Andr*0045 
                0046        idim2 = sNx+OLx
                0047        jdim2 = sNy+OLy
                0048        im1 = 1
                0049        im2 = sNx
                0050        jm1 = 1
                0051        jm2 = sNy
                0052        nymdb = nymd0
                0053        nhmsb = nhms0
                0054 
                0055 #ifdef ALLOW_MNC
                0056        if (useMNC) then
                0057         call fizhi_mnc_init(myThid)
                0058        endif
                0059 #endif
                0060 
                0061 #ifdef ALLOW_DIAGNOSTICS
                0062        if ( useDiagnostics ) then
                0063         call fizhi_diagnostics_init( myThid )
                0064        endif
                0065 #endif
                0066 
                0067        call fizhi_alarms(nymdb,nhmsb,deltaTClock)
                0068 
                0069        do bj = myByLo(myThid), myByHi(myThid)
                0070        do bi = myBxLo(myThid), myBxHi(myThid)
                0071        do j = jm1,jm2
                0072        do i = im1,im2
                0073         lons(i,j,bi,bj) = xC(i,j,bi,bj)
                0074         lats(i,j,bi,bj) = yC(i,j,bi,bj)
                0075        enddo
                0076        enddo
                0077        enddo
                0078        enddo
                0079        vegdata = 'veg19232.data'
e3d1bbfdf6 Jean*0080        call fizhi_init_veg ( myThid, vegdata,im2,jm2,nSx,nSy,
                0081      &         nSx*nPx,nSy*nPy,maxtyp,nchp,nchptot,nchpland,lons,lats,
                0082      &         surftype,tilefrac,igrd,ityp,chfr,chlt,chlon)
7ae8fb32b5 Andr*0083 
                0084 C And now fill the earth export landtype
                0085        do bj = myByLo(myThid), myByHi(myThid)
                0086        do bi = myBxLo(myThid), myBxHi(myThid)
e3d1bbfdf6 Jean*0087         call get_landfrac(im2,jm2,nSx,nSy,bi,bj,maxtyp,
                0088      &        surftype,tilefrac,fracland(1,1,bi,bj))
7ae8fb32b5 Andr*0089         do j=jm1,jm2
                0090         do i=im1,im2
                0091          landtype(i,j,bi,bj) = surftype(i,j,1,bi,bj)
                0092          if(fracland(i,j,bi,bj).ge.0.3.and.surftype(i,j,1,bi,bj).ge.100)
e3d1bbfdf6 Jean*0093      &            landtype(i,j,bi,bj) = surftype(i,j,2,bi,bj)
7ae8fb32b5 Andr*0094          if(sice(i,j,bi,bj).ne.0.0)landtype(i,j,bi,bj) = 101
                0095         enddo
                0096         enddo
                0097        enddo
                0098        enddo
                0099 
e3d1bbfdf6 Jean*0100 C Compute pressure profile to get methane and n2o values
7ae8fb32b5 Andr*0101 C     - First bottom-up (in mb)
                0102 
                0103        pressure0(1)=1000.
                0104        do L = 2,Nrphys+1
                0105         pressure0(L)=pressure0(L-1)-dpphys0(1,1,L-1,1,1)/100.
                0106        enddo
                0107 C Now flip pressure to a top-down array and average to mid levels
                0108 C     to send to fizhi init chem
                0109        do L = 1,Nrphys
                0110         pressure(L)=(pressure0(Nrphys+2-L)+pressure0(Nrphys+1-L))/2.
                0111        enddo
                0112 
e3d1bbfdf6 Jean*0113        call fizhi_init_chem(myThid,
                0114      &      nlatsoz,nlevsoz,ntimesoz,latsoz,levsoz,ozone,
                0115      &      nlatsq,nlevsq,ntimesq,latsq,levsq,stratq,
                0116      &      Nrphys,pressure,n2o,methane,co2,cfc11,cfc12,cfc22)
7ae8fb32b5 Andr*0117 
                0118        do bj = myByLo(myThid), myByHi(myThid)
                0119        do bi = myBxLo(myThid), myBxHi(myThid)
                0120         do j=jm1,jm2
                0121         do i=im1,im2
                0122          phis_var(i,j,bi,bj) = 0.
                0123         enddo
                0124         enddo
                0125        enddo
                0126        enddo
                0127 
                0128 C Finally, grab unit numbers for reading sst and sea ice
                0129 C   (held in common block fizhi ocean coms)
                0130 
                0131        call mdsfindunit( kice, myThid )
                0132        open(kice)
                0133        call mdsfindunit( ksst, myThid )
                0134        open(ksst)
                0135 
                0136        return
                0137        end