psmile_transrot_dble.F90
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_transrot_dble ( flong, flati, rmlon, rmlat )
00012
00013
00014
00015
00016
00017 use PSMILe, only : ch_id, len_cvs_string
00018
00019
00020
00021 Double Precision, Intent (In) :: flong, flati
00022
00023
00024
00025
00026
00027
00028
00029 Double Precision, Intent (Out) :: rmlat, rmlon
00030
00031
00032
00033
00034
00035
00036
00037 Double Precision :: pif, pi
00038
00039
00040 Double Precision :: fl
00041 Double Precision :: sinphi, phi
00042 Double Precision :: coslam, cosphi
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 Character(len=len_cvs_string), save :: mycvs =
00069 '$Id: psmile_transrot_dble.F90 2614 2010-09-30 12:26:43Z redler $'
00070
00071
00072
00073 #ifdef VERBOSE
00074 print 9990, trim(ch_id), flong, flati
00075 call psmile_flushstd
00076 #endif /* VERBOSE */
00077
00078
00079
00080
00081
00082
00083 pi = 4.*atan(1.)
00084 pif = pi/180.
00085
00086
00087
00088 fl = Mod(flong+360.0d0,360.0d0)
00089
00090
00091
00092
00093 sinphi=cos( flati*pif ) * sin( fl*pif )
00094 phi =asin( sinphi )
00095 cosphi=cos(phi)
00096 rmlat =phi/pif
00097
00098
00099
00100 if (cosphi.ne.0.0) then
00101 coslam=sin( fLati*pif )/cosphi
00102 if(abs(coslam).gt.1.0.and.abs(coslam)-1.0.le.1.e-14) &
00103 coslam=sign(1.0d0,coslam)
00104 rmlon =acos( coslam )/pif
00105 else
00106 rmlon =0.0
00107 if (phi.lt.0.0) rmlon=180.0
00108 endif
00109
00110
00111
00112
00113
00114
00115
00116
00117 if ( fl > 90 .and. fl < 270.0 ) rmlon = -rmlon
00118 #ifdef VERBOSE
00119 print 9980, trim(ch_id), rmlon, rmlat
00120 call psmile_flushstd
00121 #endif /* VERBOSE */
00122
00123 9990 format (1x, a, ': psmile_transrot_dble: in : ', 2f8.2)
00124 9980 format (1x, a, ': psmile_transrot_dble: out: ', 2f8.2, ' eof')
00125
00126 end subroutine psmile_transrot_dble
00127