| 1 |
C $Header: /u/gcmpack/MITgcm_contrib/darwin2/pkg/darwin/darwin_init_fixed.F,v 1.3 2013/12/04 21:21:49 jahn Exp $ |
| 2 |
C $Name: $ |
| 3 |
|
| 4 |
#include "DARWIN_OPTIONS.h" |
| 5 |
#ifdef ALLOW_EXF |
| 6 |
#include "EXF_OPTIONS.h" |
| 7 |
#endif |
| 8 |
|
| 9 |
C !INTERFACE: ========================================================== |
| 10 |
SUBROUTINE DARWIN_INIT_FIXED(myThid ) |
| 11 |
|
| 12 |
C !DESCRIPTION: |
| 13 |
C calls subroutines that initialized fixed variables for any tracer |
| 14 |
C experiment |
| 15 |
|
| 16 |
C !USES: =============================================================== |
| 17 |
IMPLICIT NONE |
| 18 |
#include "SIZE.h" |
| 19 |
#include "EEPARAMS.h" |
| 20 |
#include "PARAMS.h" |
| 21 |
#ifdef ALLOW_EXF |
| 22 |
#include "EXF_PARAM.h" |
| 23 |
#endif |
| 24 |
#include "DARWIN_SIZE.h" |
| 25 |
#include "DARWIN_IO.h" |
| 26 |
#ifdef ALLOW_SPECTRAL |
| 27 |
#include "SPECTRAL_SIZE.h" |
| 28 |
#include "SPECTRAL_PARAMS.h" |
| 29 |
#endif |
| 30 |
|
| 31 |
C !INPUT PARAMETERS: =================================================== |
| 32 |
C myThid :: thread number |
| 33 |
INTEGER myThid |
| 34 |
CEOP |
| 35 |
|
| 36 |
#ifdef ALLOW_DARWIN |
| 37 |
|
| 38 |
C !LOCAL VARIABLES: |
| 39 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
| 40 |
#ifdef ALLOW_SPECTRAL |
| 41 |
INTEGER ilam |
| 42 |
_RL planck, c, hc, oavo, hcoavo, rlamm |
| 43 |
#endif |
| 44 |
|
| 45 |
_BEGIN_MASTER(myThid) |
| 46 |
|
| 47 |
#ifdef ALLOW_SPECTRAL |
| 48 |
c Quanta conversion |
| 49 |
planck = 6.6256 _d -34 !Plancks constant J sec |
| 50 |
c = 2.998 _d 8 !speed of light m/sec |
| 51 |
hc = 1.0/(planck*c) |
| 52 |
oavo = 1.0/6.023 _d 23 ! 1/Avogadros number |
| 53 |
hcoavo = hc*oavo |
| 54 |
do ilam = 1,tlam |
| 55 |
rlamm = darwin_waves(ilam)*1 _d -9 !lambda in m |
| 56 |
WtouEins(ilam) = 1 _d 6*rlamm*hcoavo !Watts to uEin/s conversion |
| 57 |
enddo |
| 58 |
#endif |
| 59 |
|
| 60 |
C which ice area fraction to use (by preference): |
| 61 |
C 1. read from darwin_iceFile if given |
| 62 |
C 2. read from areamaskfile through exf if given |
| 63 |
C 3. use iceMask from THSICE if compiled and used |
| 64 |
C 4. use AREA from seaice if compiled and used |
| 65 |
darwin_useiceFile = .FALSE. |
| 66 |
darwin_useareamask = .FALSE. |
| 67 |
darwin_useiceMask = .FALSE. |
| 68 |
darwin_useAREA = .FALSE. |
| 69 |
darwin_haveIce = .FALSE. |
| 70 |
IF ( darwin_iceFile .NE. ' ' ) THEN |
| 71 |
darwin_useiceFile = .TRUE. |
| 72 |
darwin_haveIce = .TRUE. |
| 73 |
ENDIF |
| 74 |
#ifdef ALLOW_EXF |
| 75 |
IF (.NOT.darwin_haveIce.AND.useEXF.AND.areamaskFile.NE.' ') THEN |
| 76 |
darwin_useareamask = .TRUE. |
| 77 |
darwin_haveIce = .TRUE. |
| 78 |
#ifndef EXF_SEAICE_FRACTION |
| 79 |
WRITE(msgBuf,'(2A)') 'S/R DARWIN_INIT_FIXED:', |
| 80 |
& ' you specified an areamaskfile but EXF_SEAICE_FRACTION' |
| 81 |
CALL PRINT_ERROR( msgBuf , 1) |
| 82 |
WRITE(msgBuf,'(2A)') 'S/R DARWIN_INIT_FIXED:', |
| 83 |
& ' is not defined. You need to define it in EXF_OPTIONS.h' |
| 84 |
CALL PRINT_ERROR( msgBuf , 1) |
| 85 |
WRITE(msgBuf,'(2A)') 'S/R DARWIN_INIT_FIXED:', |
| 86 |
& ' in order to use areamaskfile.' |
| 87 |
CALL PRINT_ERROR( msgBuf , 1) |
| 88 |
STOP 'DARWIN_INIT_FIXED' |
| 89 |
#endif |
| 90 |
ENDIF |
| 91 |
#endif |
| 92 |
#ifdef ALLOW_THSICE |
| 93 |
IF ( .NOT.darwin_haveIce .AND. useTHSICE ) THEN |
| 94 |
darwin_useiceMask = .TRUE. |
| 95 |
darwin_haveIce = .TRUE. |
| 96 |
ENDIF |
| 97 |
#endif |
| 98 |
#ifdef ALLOW_SEAICE |
| 99 |
IF ( .NOT.darwin_haveIce .AND. useSEAICE ) THEN |
| 100 |
darwin_useAREA = .TRUE. |
| 101 |
darwin_haveIce = .TRUE. |
| 102 |
ENDIF |
| 103 |
#endif |
| 104 |
|
| 105 |
_END_MASTER(myThid) |
| 106 |
|
| 107 |
#ifdef ALLOW_QUOTA |
| 108 |
call QUOTA_INIT_FIXED(myThid) |
| 109 |
#endif |
| 110 |
#ifdef ALLOW_MONOD |
| 111 |
call MONOD_INIT_FIXED(myThid) |
| 112 |
#endif |
| 113 |
|
| 114 |
_BARRIER |
| 115 |
|
| 116 |
#endif /* ALLOW_DARWIN */ |
| 117 |
|
| 118 |
RETURN |
| 119 |
END |