--- MITgcm/pkg/exf/exf_mapfields.F 2003/05/23 18:37:31 1.6 +++ MITgcm/pkg/exf/exf_mapfields.F 2005/12/13 19:46:46 1.13 @@ -1,7 +1,6 @@ -c $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/exf/exf_mapfields.F,v 1.6 2003/05/23 18:37:31 heimbach Exp $ - -#include "EXF_CPPOPTIONS.h" +c $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/exf/exf_mapfields.F,v 1.13 2005/12/13 19:46:46 heimbach Exp $ +#include "EXF_OPTIONS.h" subroutine exf_mapfields( mythid ) @@ -49,9 +48,12 @@ #include "EEPARAMS.h" #include "SIZE.h" #include "FFIELDS.h" +#include "GRID.h" + #include "exf_param.h" #include "exf_constants.h" #include "exf_fields.h" +#include "exf_clim_param.h" #include "exf_clim_fields.h" #ifdef ALLOW_AUTODIFF_TAMC # include "tamc.h" @@ -66,7 +68,7 @@ c == local variables == integer bi,bj - integer i,j + integer i,j,k integer jtlo integer jthi integer itlo @@ -124,8 +126,8 @@ do j = jmin,jmax do i = imin,imax c Zonal wind stress. - if (ustress(i,j,bi,bj).gt.2.0D0) then - ustress(i,j,bi,bj)=2.0D0 + if (ustress(i,j,bi,bj).gt.windstressmax) then + ustress(i,j,bi,bj)=windstressmax endif enddo enddo @@ -134,14 +136,21 @@ #endif do j = jmin,jmax do i = imin,imax - if (ustress(i,j,bi,bj).lt.-2.0D0) then - ustress(i,j,bi,bj)=-2.0D0 + if (ustress(i,j,bi,bj).lt.-windstressmax) then + ustress(i,j,bi,bj)=-windstressmax endif enddo enddo do j = jmin,jmax - do i = imin,imax - fu(i,j,bi,bj) = exf_outscal_ustress*ustress(i,j,bi,bj) + do i = imin+1,imax +#if (defined (ALLOW_BULKFORMULAE) || defined (USE_EXF_INTERPOLATION)) +c Shift wind stresses calculated at C-points to W/S points + fu(i,j,bi,bj) = exf_outscal_ustress* + & (ustress(i,j,bi,bj)+ustress(i-1,j,bi,bj))/2.* + & maskW(i,j,1,bi,bj) +#else + fu(i,j,bi,bj) = exf_outscal_ustress*ustress(i,j,bi,bj) +#endif enddo enddo @@ -151,8 +160,8 @@ do j = jmin,jmax do i = imin,imax c Meridional wind stress. - if (vstress(i,j,bi,bj).gt.2.0D0) then - vstress(i,j,bi,bj)=2.0D0 + if (vstress(i,j,bi,bj).gt.windstressmax) then + vstress(i,j,bi,bj)=windstressmax endif enddo enddo @@ -161,14 +170,21 @@ #endif do j = jmin,jmax do i = imin,imax - if (vstress(i,j,bi,bj).lt.-2.0D0) then - vstress(i,j,bi,bj)=-2.0D0 + if (vstress(i,j,bi,bj).lt.-windstressmax) then + vstress(i,j,bi,bj)=-windstressmax endif enddo enddo - do j = jmin,jmax + do j = jmin+1,jmax do i = imin,imax - fv(i,j,bi,bj) = exf_outscal_vstress*vstress(i,j,bi,bj) +#if (defined (ALLOW_BULKFORMULAE) || defined (USE_EXF_INTERPOLATION)) +c Shift wind stresses calculated at C-points to W/S points + fv(i,j,bi,bj) = exf_outscal_vstress* + & (vstress(i,j,bi,bj)+vstress(i,j-1,bi,bj))/2.* + & maskS(i,j,1,bi,bj) +#else + fv(i,j,bi,bj) = exf_outscal_vstress*vstress(i,j,bi,bj) +#endif enddo enddo @@ -197,6 +213,30 @@ enddo #endif +#ifdef ALLOW_CLIMTEMP_RELAXATION + if ( climtempfile .NE. ' ' ) then + do k = 1, Nr + do j = jmin,jmax + do i = imin,imax + thetaStar(i,j,k,bi,bj) = climtemp(i,j,k,bi,bj) + enddo + enddo + enddo + endif +#endif + +#ifdef ALLOW_CLIMSALT_RELAXATION + if ( climsaltfile .NE. ' ' ) then + do k = 1, Nr + do j = jmin,jmax + do i = imin,imax + saltStar(i,j,k,bi,bj) = climsalt(i,j,k,bi,bj) + enddo + enddo + enddo + endif +#endif + #ifdef ATMOSPHERIC_LOADING do j = jmin,jmax do i = imin,imax @@ -224,6 +264,12 @@ #ifdef ALLOW_CLIMSSS_RELAXATION _EXCH_XY_R4( sss, mythid ) #endif +#ifdef ALLOW_CLIMTEMP_RELAXATION + _EXCH_XYZ_R4( thetaStar, mythid ) +#endif +#ifdef ALLOW_CLIMSALT_RELAXATION + _EXCH_XYZ_R4( saltStar, mythid ) +#endif #ifdef ATMOSPHERIC_LOADING _EXCH_XY_R4( pload, mythid ) #endif