File indexing completed on 2023-09-21 05:10:49 UTC
view on githubraw file Latest commit 96b00645 on 2023-09-20 15:15:14 UTC
578fad1ab3 Jean*0001 #include "STREAMICE_OPTIONS.h"
96b006450c dngo*0002
0003
0004
5ca83cd8f7 Dani*0005 #ifdef ALLOW_COST
0006 # include "COST_OPTIONS.h"
0007 #endif
0008
96b006450c dngo*0009 subroutine streamice_cost_surf_accum ( myIter, myThid )
578fad1ab3 Jean*0010
96b006450c dngo*0011
0012
0013
578fad1ab3 Jean*0014
5ca83cd8f7 Dani*0015
0016
0017
578fad1ab3 Jean*0018
5ca83cd8f7 Dani*0019 IMPLICIT NONE
0020
0021
0022 #include "SIZE.h"
96b006450c dngo*0023 #include "GRID.h"
5ca83cd8f7 Dani*0024 #include "EEPARAMS.h"
0025 #include "PARAMS.h"
0026 #include "DYNVARS.h"
0027 #ifdef ALLOW_STREAMICE
0028 # include "STREAMICE.h"
0029 #endif
0030
0031 #ifdef ALLOW_COST
0032 # include "cost.h"
578fad1ab3 Jean*0033 #endif
96b006450c dngo*0034
0035
0036
5ca83cd8f7 Dani*0037
0038
0039
96b006450c dngo*0040 integer myIter, myThid
5ca83cd8f7 Dani*0041
96b006450c dngo*0042 #ifdef ALLOW_STREAMICE_TC_COST
5ca83cd8f7 Dani*0043
96b006450c dngo*0044 _RL HAF
5ca83cd8f7 Dani*0045 integer i, j, k, bi, bj
0046 integer ig, jg
0047 integer itlo,ithi
0048 integer jtlo,jthi
7493c1d2cc Patr*0049 integer il
96b006450c dngo*0050 CHARACTER*(10) myIterStr
5ca83cd8f7 Dani*0051 INTEGER ILNBLNK
0052 EXTERNAL ILNBLNK
96b006450c dngo*0053 CHARACTER*(MAX_LEN_FNAM) surffilename, errsurffilename
0054 _RL surfobs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
0055 _RL errsurfobs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
0056 _RL rhoi, rhow, r, i_r, i_numcells, surf_err, h, hf
0057 WRITE(myIterStr,'(I10.10)') myIter
0058 surffilename=STREAMICEsurfOptimTCBasename(1:
0059 & ILNBLNK(STREAMICEsurfOptimTCBasename))//myIterStr//".bin"
0060 errsurffilename=STREAMICEsurfOptimTCBasename(1:
0061 & ILNBLNK(STREAMICEsurfOptimTCBasename))//myIterStr//"err.bin"
0062 CALL READ_FLD_XY_RL( surffilename, ' ', surfobs,
0063 & 0, myThid )
0064 CALL READ_FLD_XY_RL( errsurffilename, ' ', errsurfobs,
0065 & 0, myThid )
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076 rhoi = streamice_density
0077 rhow = streamice_density_ocean_avg
0078 r=rhoi/rhow
0079 i_r = 1./r
0080 i_numcells = 1.0/(Nx*Ny)
5ca83cd8f7 Dani*0081
0082
96b006450c dngo*0083 DO bj=myByLo(myThid),myByHi(myThid)
0084 DO bi=myBxLo(myThid),myBxHi(myThid)
5ca83cd8f7 Dani*0085 do j=1,sNy
0086 do i=1,sNx
96b006450c dngo*0087 if (SURFOBS(i,j,bi,bj).ge.-999990. .and.
0088 & streamice_hmask(i,j,bi,bj).eq.1.0) THEN
0089
0090 h = H_streamice(i,j,bi,bj)
0091 hf = -1.0 * i_r * R_low_si (i,j,bi,bj)
0092
0093 if (((h-hf) .gt. 5.) .OR.
0094 & STREAMICE_shelf_dhdt_ctrl) then
0095
0096 surf_err = streamice_wgt_surf * i_numcells *
0097 & (surf_el_streamice(i,j,bi,bj) -
0098 & surfobs(i,j,bi,bj))**2 /
0099 & (.001 + errSurfObs(i,j,bi,bj)**2)
0100
0101 cost_func1_streamice (bi,bj) =
0102 & cost_func1_streamice (bi,bj) +
0103 & surf_err
0104 cost_surf_streamice (bi,bj) =
0105 & cost_surf_streamice (bi,bj) +
0106 & surf_err
0107
0108 endif
5ca83cd8f7 Dani*0109
0110 endif
0111
0112 end do
0113 end do
0114 end do
0115 end do
0116
0117 #endif
0118
0119 RETURN
0120 END