--- MITgcm/pkg/seaice/seaice_cost_sss.F 2010/03/15 18:31:11 1.1 +++ MITgcm/pkg/seaice/seaice_cost_sss.F 2012/11/09 22:15:18 1.7 @@ -1,9 +1,11 @@ -c ian fenty -#include "COST_CPPOPTIONS.h" +C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/seaice/seaice_cost_sss.F,v 1.7 2012/11/09 22:15:18 heimbach Exp $ +C $Name: $ + +#include "SEAICE_OPTIONS.h" c read the area dat file and compare against the averaged salinity file - subroutine seaice_cost_sss( + subroutine seaice_cost_sss( & nnzbar, localbarfile, localbar, xx_localbar_mean_dummy, & areabarfile, areabar, xx_areabar_mean_dummy, & nnzobs, localobsfile, localobs, mult_local, @@ -15,6 +17,7 @@ implicit none +c ian fenty c == global variables == #include "EEPARAMS.h" @@ -24,10 +27,13 @@ # include "cal.h" #endif #ifdef ALLOW_COST -# include "ecco_cost.h" # include "optim.h" +# ifdef ALLOW_ECCO +# include "ecco_cost.h" +# endif # ifdef ALLOW_SEAICE # include "SEAICE_COST.h" +# include "SEAICE_SIZE.h" # include "SEAICE_PARAMS.h" # endif #endif @@ -46,7 +52,7 @@ _RL localobs (1-olx:snx+olx,1-oly:sny+oly,nnzobs,nsx,nsy) _RL localweight(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy) - _RL localmask (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) + _RS localmask (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy) _RL xx_localbar_mean_dummy _RL xx_areabar_mean_dummy _RL mult_local @@ -62,7 +68,7 @@ character*(MAX_LEN_FNAM) localbarfile character*(MAX_LEN_FNAM) localobsfile -#ifdef ALLOW_COST +#if (defined (ALLOW_ECCO) && defined (ALLOW_COST)) c == local variables == integer bi,bj @@ -85,7 +91,7 @@ _RL localcost _RL junk - _RL cmask (1-olx:snx+olx,1-oly:sny+oly,nnzobs) + _RL cmask (1-olx:snx+olx,1-oly:sny+oly,nnzobs) character*(128) fname1, fname2,fname3 character*(MAX_LEN_MBUF) msgbuf @@ -141,12 +147,12 @@ write(fname3(1:128),'(80a)') ' ' il=ilnblnk( localbarfile ) - write(fname1(1:128),'(2a,i10.10)') + write(fname1(1:128),'(2a,i10.10)') & localbarfile(1:il),'.',optimcycle csss il=ilnblnk( areabarfile ) - write(fname3(1:128),'(2a,i10.10)') + write(fname3(1:128),'(2a,i10.10)') & areabarfile(1:il),'.',optimcycle if ( .NOT. ( localobsfile.EQ.' ' ) ) then @@ -156,22 +162,22 @@ if ( nnzbar .EQ. 1 ) then call active_read_xy( fname1, localbar, irec, doglobalread, - & ladinit, optimcycle, mythid, + & ladinit, optimcycle, mythid, & xx_localbar_mean_dummy ) else call active_read_xyz( fname1, localbar, irec, doglobalread, - & ladinit, optimcycle, mythid, + & ladinit, optimcycle, mythid, & xx_localbar_mean_dummy ) endif csss if ( nnzbar .EQ. 1 ) then call active_read_xy( fname3, areabar, irec, doglobalread, - & ladinit, optimcycle, mythid, + & ladinit, optimcycle, mythid, & xx_areabar_mean_dummy ) else call active_read_xyz( fname3, areabar, irec, doglobalread, - & ladinit, optimcycle, mythid, + & ladinit, optimcycle, mythid, & xx_areabar_mean_dummy ) endif @@ -199,10 +205,10 @@ print *,'ymod, yday ', ymod,yday print *,'smrarstrtdt(1) ', smrareastartdate(1) print *,'smrarstartdate ', smrareastartdate -#endif SEAICE_DEBUG +#endif /* SEAICE_DEBUG */ if ( ymod .EQ. yday ) then - middate(1) = smrareastartdate(1) + middate(1) = smrareastartdate(1) else middate(1) = yday*10000+100+1 endif @@ -221,7 +227,7 @@ print *,'middate(3,4) ', middate(3),middate(4) print *,'difftime,diffsecs',difftime,diffsecs print *,'localrec ',localrec -#endif +#endif il=ilnblnk(localobsfile) write(fname2(1:128),'(2a,i4)') @@ -240,13 +246,13 @@ #endif endif - if ( localrec .GT. 0 ) then + if ( localrec .GT. 0 ) then #ifdef SEAICE_DEBUG print *,'calling mdsreadfile',fname2,localrec #endif - call mdsreadfield( fname2, cost_iprec, cost_yftype, nnzobs, + call mdsreadfield( fname2, cost_iprec, cost_yftype, nnzobs, & localobs, localrec, mythid ) else do bj = jtlo,jthi @@ -304,10 +310,10 @@ localwww = localweight(i,j,bi,bj)*cmask(i,j,k) c only accumulate cost if there is ice observed but not simulated.. - if ( localobs(i,j,k,bi,bj) .GT. 0.0 .AND. + if ( localobs(i,j,k,bi,bj) .GT. 0.0 .AND. & areabar(i,j,1,bi,bj) .LE. 0.0) then -c if ( localobs(i,j,k,bi,bj) .GT. +c if ( localobs(i,j,k,bi,bj) .GT. c & areabar(i,j,1,bi,bj)) then junk = ( localbar(i,j,k,bi,bj) - SEAICE_clamp_salt ) @@ -332,8 +338,8 @@ print '(A,2i4,2(1x,1P2E15.3))', & 'costg i j bar-obs,wgt,loCost ',i,j, - & junk, - & localwww, + & junk, + & localwww, & localcost endif #endif