| 1 |
C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_itd_pickup.F,v 1.2 2012/10/23 13:20:49 jmc Exp $ |
| 2 |
C $Name: $ |
| 3 |
|
| 4 |
#include "SEAICE_OPTIONS.h" |
| 5 |
|
| 6 |
C !ROUTINE: SEAICE_ITD_PICKUP |
| 7 |
|
| 8 |
C !INTERFACE: ========================================================== |
| 9 |
SUBROUTINE SEAICE_ITD_PICKUP( |
| 10 |
I myIter, myThid ) |
| 11 |
|
| 12 |
C !DESCRIPTION: \bv |
| 13 |
C *===========================================================* |
| 14 |
C | SUBROUTINE SEAICE_ITD_PICKUP |
| 15 |
C | o called in case pickup file does not contain |
| 16 |
C | ITD variables but mean ice thickness and concentration |
| 17 |
C | |
| 18 |
C | o choose between two schemes: |
| 19 |
C | |
| 20 |
C | a) a simple scheme where the mean values are just put |
| 21 |
C | into the first ITD category and then redustributed |
| 22 |
C | into the correct category by SEAICE_ITD_REDIST |
| 23 |
C | -> simpleSchemeFlag = .TRUE. |
| 24 |
C | |
| 25 |
C | b) a scheme that assumes a log-normal distribution based |
| 26 |
C | on the mean ice thickness and a standard decviation |
| 27 |
C | of LND_sigma=0.25 |
| 28 |
C | -> simpleSchemeFlag = .FALSE. |
| 29 |
C | |
| 30 |
C | Torge Martin, Mai 2012, torge@mit.edu |
| 31 |
C *===========================================================* |
| 32 |
C \ev |
| 33 |
|
| 34 |
C !USES: =============================================================== |
| 35 |
IMPLICIT NONE |
| 36 |
|
| 37 |
C === Global variables needed === |
| 38 |
C AREA :: total sea ice area fraction |
| 39 |
C HEFF :: mean in-situ sea ice thickness |
| 40 |
C HSNOW :: mean in-situ snow layer depth |
| 41 |
C |
| 42 |
C === Global variables to be changed === |
| 43 |
C AREAITD :: sea ice area by category |
| 44 |
C HEFFITD :: sea ice thickness by category |
| 45 |
C HSNOWITD :: snow thickness by category |
| 46 |
C |
| 47 |
#include "SIZE.h" |
| 48 |
#include "EEPARAMS.h" |
| 49 |
#include "PARAMS.h" |
| 50 |
#include "GRID.h" |
| 51 |
#include "SEAICE_SIZE.h" |
| 52 |
#include "SEAICE_PARAMS.h" |
| 53 |
#include "SEAICE.h" |
| 54 |
|
| 55 |
#ifdef ALLOW_AUTODIFF_TAMC |
| 56 |
# include "tamc.h" |
| 57 |
#endif |
| 58 |
|
| 59 |
C !INPUT PARAMETERS: =================================================== |
| 60 |
C === Routine arguments === |
| 61 |
C myIter :: iteration number |
| 62 |
C myThid :: Thread no. that called this routine. |
| 63 |
INTEGER myIter |
| 64 |
INTEGER myThid |
| 65 |
CEndOfInterface |
| 66 |
|
| 67 |
#ifdef SEAICE_ITD |
| 68 |
|
| 69 |
C !LOCAL VARIABLES: ==================================================== |
| 70 |
C === Local variables === |
| 71 |
C i,j,bi,bj,k :: Loop counters |
| 72 |
C nITD :: number of sea ice thickness categories |
| 73 |
C |
| 74 |
INTEGER i, j, bi, bj, k |
| 75 |
#ifdef ALLOW_AUTODIFF_TAMC |
| 76 |
INTEGER itmpkey |
| 77 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
| 78 |
_RL dummyTime |
| 79 |
|
| 80 |
C local variables for picking up ITD from single category pickup file |
| 81 |
INTEGER LND_i, LND_iend |
| 82 |
C parameters for log-normal distribution (LND) |
| 83 |
_RL LND_sigma, LND_mu |
| 84 |
PARAMETER(LND_sigma=0.25) |
| 85 |
_RL LND_dx |
| 86 |
_RL LND_tmp |
| 87 |
C bin width of distribution |
| 88 |
PARAMETER( LND_iend = 1000 ) |
| 89 |
PARAMETER( LND_dx = 100.D0 / LND_iend ) |
| 90 |
c PARAMETER(LND_dx=0.1) |
| 91 |
c PARAMETER(LND_iend=INT(100./LND_dx)) |
| 92 |
_RL LND_x (LND_iend) |
| 93 |
_RL LND_pdf(LND_iend) |
| 94 |
C flag for pickup scheme |
| 95 |
LOGICAL simpleSchemeFlag |
| 96 |
|
| 97 |
simpleSchemeFlag = .TRUE. |
| 98 |
dummyTime = 1.0 |
| 99 |
|
| 100 |
C---+-|--1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
| 101 |
IF (simpleSchemeFlag) THEN |
| 102 |
C-- Put all ice into one bin: |
| 103 |
C |
| 104 |
DO bj=myByLo(myThid),myByHi(myThid) |
| 105 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
| 106 |
DO j=1-OLy,sNy+OLy |
| 107 |
DO i=1-OLx,sNx+OLx |
| 108 |
AREAITD(i,j,1,bi,bj) = AREA(i,j,bi,bj) |
| 109 |
HEFFITD(i,j,1,bi,bj) = HEFF(i,j,bi,bj) |
| 110 |
HSNOWITD(i,j,1,bi,bj) = HSNOW(i,j,bi,bj) |
| 111 |
ENDDO |
| 112 |
ENDDO |
| 113 |
ENDDO |
| 114 |
ENDDO |
| 115 |
|
| 116 |
C---+-|--1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
| 117 |
ELSE |
| 118 |
C-- Assume log-normal ITD: |
| 119 |
|
| 120 |
DO bj=myByLo(myThid),myByHi(myThid) |
| 121 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
| 122 |
DO j=1-OLy,sNy+OLy |
| 123 |
DO i=1-OLx,sNx+OLx |
| 124 |
C |
| 125 |
C initialize log-normal distribution |
| 126 |
LND_mu = log(HEFF(i,j,bi,bj)/AREA(i,j,bi,bj)) |
| 127 |
& - 0.5*LND_sigma*LND_sigma |
| 128 |
LND_x(1) = 0.+LND_dx/2. |
| 129 |
C make thickness bins |
| 130 |
DO LND_i=2,LND_iend |
| 131 |
LND_x(LND_i)=LND_x(LND_i-1)+LND_dx |
| 132 |
ENDDO |
| 133 |
C log-normal distribution: |
| 134 |
DO LND_i=2,LND_iend |
| 135 |
LND_tmp = log(LND_x(LND_i))-LND_mu |
| 136 |
LND_pdf(LND_i)= 1. |
| 137 |
& / (LND_x(LND_i)*LND_sigma*sqrt(2*3.1416)) |
| 138 |
& * exp( -(LND_tmp*LND_tmp) |
| 139 |
& / (2*LND_sigma*LND_sigma) ) |
| 140 |
& * AREA(i,j,bi,bj) |
| 141 |
ENDDO |
| 142 |
C assign bins to ice thickness categories |
| 143 |
k=1 |
| 144 |
DO LND_i=1,LND_iend |
| 145 |
IF ( LND_x(LND_i).GT.Hlimit(k) ) k=k+1 |
| 146 |
AREAITD(i,j,k,bi,bj) = AREAITD(i,j,k,bi,bj) |
| 147 |
& + LND_pdf(LND_i)*LND_dx |
| 148 |
HEFFITD(i,j,k,bi,bj) = HEFFITD(i,j,k,bi,bj) |
| 149 |
& + LND_pdf(LND_i)*LND_x(LND_i)*LND_dx |
| 150 |
ENDDO |
| 151 |
C |
| 152 |
ENDDO |
| 153 |
ENDDO |
| 154 |
ENDDO |
| 155 |
ENDDO |
| 156 |
|
| 157 |
ENDIF |
| 158 |
|
| 159 |
C---+-|--1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
| 160 |
C finally sort into correct ice thickness category |
| 161 |
C and compute bulk variables |
| 162 |
C (needed for dynamic solver at beginning of seaice_model.F) |
| 163 |
DO bj=myByLo(myThid),myByHi(myThid) |
| 164 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
| 165 |
CALL SEAICE_ITD_REDIST( bi, bj, dummyTime, myIter, myThid) |
| 166 |
CALL SEAICE_ITD_SUM( bi, bj, dummyTime, myIter, myThid) |
| 167 |
ENDDO |
| 168 |
ENDDO |
| 169 |
|
| 170 |
C---+-|--1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
| 171 |
#endif /* SEAICE_ITD */ |
| 172 |
RETURN |
| 173 |
END |