[95] | 1 | SUBROUTINE init_ocean |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
| 4 | ! Actual revisions: |
---|
| 5 | ! ----------------- |
---|
[139] | 6 | ! |
---|
[95] | 7 | ! |
---|
| 8 | ! Former revisions: |
---|
| 9 | ! ------------------ |
---|
[96] | 10 | ! $Id: init_ocean.f90 336 2009-06-10 11:19:35Z heinze $ |
---|
[95] | 11 | ! |
---|
[139] | 12 | ! 124 2007-10-19 15:47:46Z raasch |
---|
| 13 | ! Bugfix: Initial density rho is calculated |
---|
| 14 | ! |
---|
[98] | 15 | ! 97 2007-06-21 08:23:15Z raasch |
---|
| 16 | ! Initial revision |
---|
[95] | 17 | ! |
---|
| 18 | ! Description: |
---|
| 19 | ! ------------ |
---|
| 20 | ! Initialization of quantities needed for the ocean version |
---|
| 21 | !------------------------------------------------------------------------------! |
---|
| 22 | |
---|
| 23 | USE arrays_3d |
---|
| 24 | USE control_parameters |
---|
| 25 | USE eqn_state_seawater_mod |
---|
[336] | 26 | USE pegrid |
---|
[95] | 27 | USE grid_variables |
---|
| 28 | USE indices |
---|
| 29 | |
---|
| 30 | IMPLICIT NONE |
---|
| 31 | |
---|
[336] | 32 | INTEGER :: k, n |
---|
[95] | 33 | |
---|
| 34 | REAL :: sa_l, pt_l, rho_l |
---|
| 35 | |
---|
[336] | 36 | REAL, DIMENSION(nzb:nzt+1) :: rho_init |
---|
| 37 | |
---|
[95] | 38 | ALLOCATE( hyp(nzb:nzt+1) ) |
---|
| 39 | |
---|
| 40 | ! |
---|
| 41 | !-- Set water density near the ocean surface |
---|
| 42 | rho_surface = 1027.62 |
---|
| 43 | |
---|
| 44 | ! |
---|
| 45 | !-- Calculate initial vertical profile of hydrostatic pressure (in Pa) |
---|
[96] | 46 | !-- and the reference density (used later in buoyancy term) |
---|
[95] | 47 | hyp(nzt+1) = surface_pressure * 100.0 |
---|
| 48 | |
---|
[97] | 49 | hyp(nzt) = hyp(nzt+1) + rho_surface * g * 0.5 * dzu(nzt+1) |
---|
[336] | 50 | rho_init(nzt) = rho_surface |
---|
[95] | 51 | |
---|
| 52 | DO k = nzt-1, 0, -1 |
---|
[336] | 53 | hyp(k) = hyp(k+1) + rho_surface * g * dzu(k) |
---|
| 54 | ENDDO |
---|
[95] | 55 | |
---|
[336] | 56 | IF ( myid == 0 ) THEN |
---|
| 57 | print*,'hydro pres using rho_surface' |
---|
| 58 | DO k = nzt+1, 0, -1 |
---|
| 59 | print*, 'k = ', k, ' hyp = ', hyp(k) |
---|
| 60 | ENDDO |
---|
| 61 | print*, ' ' |
---|
| 62 | ENDIF |
---|
[95] | 63 | |
---|
[336] | 64 | DO n = 1, 5 |
---|
[95] | 65 | |
---|
[336] | 66 | rho_reference = rho_surface * 0.5 * dzu(nzt+1) |
---|
[95] | 67 | |
---|
[336] | 68 | DO k = nzt-1, 0, -1 |
---|
| 69 | |
---|
| 70 | sa_l = 0.5 * ( sa_init(k) + sa_init(k+1) ) |
---|
| 71 | pt_l = 0.5 * ( pt_init(k) + pt_init(k+1) ) |
---|
| 72 | |
---|
| 73 | rho_init(k) = eqn_state_seawater_func( hyp(k), pt_l, sa_l ) |
---|
| 74 | |
---|
| 75 | rho_reference = rho_reference + rho_init(k) * dzu(k+1) |
---|
| 76 | |
---|
| 77 | ENDDO |
---|
| 78 | |
---|
| 79 | rho_reference = rho_reference / ( zw(nzt) - zu(nzb) ) |
---|
| 80 | |
---|
| 81 | DO k = nzt-1, 0, -1 |
---|
| 82 | hyp(k) = hyp(k+1) + g * 0.5 * ( rho_init(k) + rho_init(k+1 ) ) * & |
---|
| 83 | dzu(k+1) |
---|
| 84 | ENDDO |
---|
| 85 | |
---|
| 86 | IF ( myid == 0 ) THEN |
---|
| 87 | print*,'hydro pres / rho n = ', n |
---|
| 88 | DO k = nzt+1, 0, -1 |
---|
| 89 | print*, 'k = ', k, ' hyp = ', hyp(k), ' rho = ', rho_init(k) |
---|
| 90 | ENDDO |
---|
| 91 | print*, ' ' |
---|
| 92 | ENDIF |
---|
| 93 | |
---|
[95] | 94 | ENDDO |
---|
| 95 | |
---|
[97] | 96 | ! |
---|
| 97 | !-- Calculate the reference potential density |
---|
| 98 | prho_reference = 0.0 |
---|
| 99 | DO k = 0, nzt |
---|
[96] | 100 | |
---|
[97] | 101 | sa_l = 0.5 * ( sa_init(k) + sa_init(k+1) ) |
---|
| 102 | pt_l = 0.5 * ( pt_init(k) + pt_init(k+1) ) |
---|
| 103 | |
---|
| 104 | prho_reference = prho_reference + dzu(k+1) * & |
---|
[336] | 105 | eqn_state_seawater_func( 0.0, pt_l, sa_l ) |
---|
[97] | 106 | |
---|
| 107 | ENDDO |
---|
| 108 | |
---|
| 109 | prho_reference = prho_reference / ( zu(nzt) - zu(nzb) ) |
---|
| 110 | |
---|
[124] | 111 | ! |
---|
| 112 | !-- Calculate the initial potential density, based on the initial |
---|
| 113 | !-- temperature and salinity profile |
---|
| 114 | CALL eqn_state_seawater |
---|
[97] | 115 | |
---|
[124] | 116 | |
---|
[95] | 117 | END SUBROUTINE init_ocean |
---|