Variables in explanation
long1 is the longitude varying from -180 to 180 or 180W-180E
long3 is the longitude variable from 0 to 360 (all positive)
To convert longitude from (0-360) to (-180 to 180)
Matlab and fortran
long1=mod((long3+180),360)-180
Matlab
long1=rem((long3+180),360)-180
Fortran
long1=modulo((long3+180),360)-180
To convert longitude from (-180 to 180) to (0-360)
Matlab
lon3=mod(lon1,360)
Fortran
lon3=modulo(lon1,360)
The “mod” function is Fortran is equivalent to “rem” function in Matlab.
The “modulo” function in Fortran is equivalent to “mod” function in Matlab.
Tuesday, June 29, 2010
Thursday, June 10, 2010
int2str and str2num in fortran, How convert string to integer number of vice versa.
To convert a number/integer to a string, you need to write the variable into the string character.
Integer I
Character* str
I = 9999
Write( str, '(i10)' ) I
End
To convert a string to number or integer, you need to read the strign and assign it to the integer
Integer I
Character* str
I = 9999
read( str, '(i10)' ) I
End
Integer I
Character* str
I = 9999
Write( str, '(i10)' ) I
End
To convert a string to number or integer, you need to read the strign and assign it to the integer
Integer I
Character* str
I = 9999
read( str, '(i10)' ) I
End
Posted by
vicky
at
12:18 PM
Subscribe to:
Posts (Atom)
Popular
- How to add or endorse Spouse/ Husband /Wife name of the passport
- New Rules to add spouse name in the Indian passport
- How to invite wife or spouse to Italy
- Traveling to Germany and schengen area is allowed with expired permit and poste intalian receipt (permesso+ricevuta)
- Jawahar Navodaya Vidyalaya Rajsamand, My feelings and emotions for JNVR