Changeset 1161 for trunk/LMDZ.GENERIC/libf/phystd/rings.F90
- Timestamp:
- Jan 21, 2014, 4:07:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/rings.F90
r1133 r1161 40 40 REAL, DIMENSION(:), ALLOCATABLE:: x, y, z ! cartesian coordinates of the points on the planet 41 41 REAL :: xs, ys, zs ! cartesian coordinates of the points of the subsolar point 42 REAL, DIMENSION(:), ALLOCATABLE :: k ! parameter (?)42 REAL, DIMENSION(:), ALLOCATABLE :: k 43 43 REAL, DIMENSION(:), ALLOCATABLE :: N ! parameter to compute cartesian coordinates on a ellipsoidal planet 44 44 REAL, DIMENSION(:), ALLOCATABLE :: r ! distance at which the incident ray of sun crosses the equatorial plane … … 48 48 ! equinox --> no shadow (AS: why is this needed?) 49 49 if(declin .eq. 0.) then 50 eclipse = 0.50 eclipse(:) = 0. 51 51 return 52 52 endif … … 63 63 ALLOCATE(N(ngrid)) 64 64 ALLOCATE(r(ngrid)) 65 eclipse = 2000.65 eclipse(:) = 2000. 66 66 67 67 ! Size of the rings … … 85 85 86 86 ! Convert to cartesian coordinates 87 N = rad/sqrt(1-(e**2)*sinlat**2)88 x = N*coslat*coslon89 y = N*coslat*sinlon90 z = N*(1-e**2)*sinlat87 N(:) = rad / sqrt(1-(e**2)*sinlat(:)**2) 88 x(:) = N(:)*coslat(:)*coslon(:) 89 y(:) = N(:)*coslat(:)*sinlon(:) 90 z(:) = N(:)*(1-e**2)*sinlat(:) 91 91 92 92 ! 2) LOCATION OF THE SUBSOLAR POINT … … 95 95 ! SG: the minus sign is important! ... otherwise subsolar point adopts a reverse rotation 96 96 phi_S = -(ptime - 0.5)*2.*pi 97 write(*,*) 'subsol point coords : ', declin*180./pi, phi_S*180./pi97 ! write(*,*) 'subsol point coords : ', declin*180./pi, phi_S*180./pi 98 98 99 99 ! subsolar latitude is declin (declination of the sun) … … 106 106 ! 3) WHERE DOES THE INCIDENT RAY OF SUN CROSS THE EQUATORIAL PLAN ? 107 107 108 k = -z/zs109 r = (k*xs + x)**2 + (k*ys + y)**2110 r = sqrt(r)108 k(:) = -z(:)/zs 109 r(:) = (k(:)*xs + x(:))**2 + (k(:)*ys + y(:))**2 110 r(:) = sqrt(r(:)) 111 111 112 112 ! 4) SO WHERE ARE THE SHADOW OF THESE RINGS ? 113 113 114 114 ! Summer hemisphere is not under the shadow of the rings 115 where(lati *declin .gt. 0.)116 eclipse = 1000.115 where(lati(:)*declin .gt. 0.) 116 eclipse(:) = 1000. 117 117 end where 118 118 119 119 ! No shadow of the rings by night 120 where(x *xs + y*ys + z*zs .lt. 0.)121 eclipse = 1000.120 where(x(:)*xs + y(:)*ys + z(:)*zs .lt. 0.) 121 eclipse(:) = 1000. 122 122 end where 123 123 124 124 ! if the incident rays of sun cross a ring, there is a shadow 125 125 do i=1, nb_A 126 where(r .ge. A_Rint(i) .and. r .le. A_Rext(i) .and. eclipse.ne. 1000.)127 eclipse = 1. - exp(-tau_A(i)/cos(declin))126 where(r(:) .ge. A_Rint(i) .and. r(:) .le. A_Rext(i) .and. eclipse(:) .ne. 1000.) 127 eclipse(:) = 1. - exp(-tau_A(i)/cos(declin)) 128 128 end where 129 129 end do 130 130 131 131 do i=1, nb_B 132 where(r .ge. B_Rint(i) .and. r .le. B_Rext(i) .and. eclipse.ne. 1000.)133 eclipse = 1. - exp(-tau_B(i)/cos(declin))132 where(r(:) .ge. B_Rint(i) .and. r(:) .le. B_Rext(i) .and. eclipse(:) .ne. 1000.) 133 eclipse(:) = 1. - exp(-tau_B(i)/cos(declin)) 134 134 end where 135 135 enddo 136 136 137 137 do i=1, nb_C 138 where(r .ge. C_Rint(i) .and. r .le. C_Rext(i) .and. eclipse.ne. 1000.)139 eclipse = 1. - exp(-tau_C(i)/cos(declin))138 where(r(:) .ge. C_Rint(i) .and. r(:) .le. C_Rext(i) .and. eclipse(:) .ne. 1000.) 139 eclipse(:) = 1. - exp(-tau_C(i)/cos(declin)) 140 140 end where 141 141 enddo 142 142 143 143 ! At the other places and the excluded ones, eclipse is 0. 144 where(eclipse .eq. 2000. .or. eclipse.eq. 1000.)145 eclipse = 0.144 where(eclipse(:) .eq. 2000. .or. eclipse(:) .eq. 1000.) 145 eclipse(:) = 0. 146 146 end where 147 147
Note: See TracChangeset
for help on using the changeset viewer.