residual.F90 1.91 KB
Newer Older
 kbk committed Mar 01, 2006 1 !$Id: residual.F90,v 1.7 2006-03-01 15:54:07 kbk Exp$  gotm committed May 02, 2002 2 3 4 5 #include "cppdefs.h" !----------------------------------------------------------------------- !BOP !  hb committed Mar 01, 2006 6 ! !ROUTINE: do_residual - barotropic residual currents.  gotm committed May 02, 2002 7 8 9 10 11 12 ! ! !INTERFACE: subroutine do_residual(finish) ! ! !DESCRIPTION: !  hb committed Feb 04, 2006 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ! Here, the residual transports and depths are integrated up every time step. ! At the end of the simulation, the Eulerian residual currents are ! calculated from: ! ! ! u_{res} = ! \frac{\displaystyle\int_{t_0}^{t_1}U\,\mbox{d}\tau} ! {\displaystyle\int_{t_0}^{t_1}D^u\,\mbox{d}\tau}, \quad ! v_{res} = ! \frac{\displaystyle\int_{t_0}^{t_1}V\,\mbox{d}\tau} ! {\displaystyle\int_{t_0}^{t_1}D^v\,\mbox{d}\tau}, ! ! ! where $t_0$ is the time when the residual calculation begins (to be ! chosen from namelist) and $t_1$ is the finishing time of the model simulation. ! !  gotm committed May 02, 2002 30 ! !USES:  kbk committed Jan 03, 2004 31  use variables_2d, only: u,v,res_du,res_u,res_dv,res_v,du,dv  gotm committed May 02, 2002 32 33 34  IMPLICIT NONE ! ! !INPUT PARAMETERS:  kbk committed Apr 23, 2003 35  integer, intent(in) :: finish  gotm committed May 02, 2002 36 37 38 39 40 ! ! !INPUT/OUTPUT PARAMETERS: ! ! !OUTPUT PARAMETERS: !  kbk committed Mar 01, 2006 41 42 43 ! !REVISION HISTORY: ! Original author(s): Karsten Bolding & Hans Burchard !  gotm committed May 02, 2002 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 ! !LOCAL VARIABLES: !EOP !----------------------------------------------------------------------- !BOC if(finish .eq. 1) then LEVEL2 'Calculating residual currents' where ( res_du .ne. _ZERO_ ) res_u=res_u/res_du elsewhere res_u= _ZERO_ end where where ( res_dv .ne. _ZERO_ ) res_v=res_v/res_dv elsewhere res_v= _ZERO_ end where else  kbk committed Jan 03, 2004 61  res_du=res_du+du  gotm committed May 02, 2002 62  res_u=res_u+u  kbk committed Jan 03, 2004 63  res_dv=res_dv+dv  gotm committed May 02, 2002 64 65 66 67 68 69 70 71 72 73  res_v=res_v+v end if return end subroutine do_residual !EOC !----------------------------------------------------------------------- ! Copyright (C) 2001 - Hans Burchard and Karsten Bolding ! !-----------------------------------------------------------------------