Changeset 8689
- Timestamp:
- 06/22/11 15:51:08 (14 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/Ll2xyx/Ll2xyx.cpp
r8673 r8689 28 28 29 29 double delta,slat; 30 bool flag= false;30 bool flag=true; 31 31 32 32 /* Get central_meridian and standard_parallel depending on hemisphere */ … … 34 34 delta = 45; 35 35 slat = 70; 36 _printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 70N Meridian: 45) ");36 _printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 70N Meridian: 45).\n"); 37 37 } 38 38 else if (sgn == -1) { 39 39 delta = 0; 40 40 slat = 71; 41 _printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0) ");41 _printf_(flag,"Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n"); 42 42 } 43 43 else 44 _error_("Sign should be either +1 or -1 ");44 _error_("Sign should be either +1 or -1.\n"); 45 45 46 return(Ll2xyx( lat,lon,47 x,y,ncoord,46 return(Ll2xyx(x,y, 47 lat,lon,ncoord, 48 48 sgn,delta,slat)); 49 49 } … … 68 68 */ 69 69 70 int i ;70 int i,iret=0; 71 71 double delta,slat; 72 72 double cde,re,ex2,ex,pi; … … 75 75 76 76 if ((sgn != 1) && (sgn != -1)) 77 _error_("Sign should be either +1 or -1 ");77 _error_("Sign should be either +1 or -1.\n"); 78 78 79 79 delta = central_meridian; … … 109 109 } 110 110 111 y[i] = -rho * sgn * cos(sgn*longitude);112 x[i] = rho * sgn * sin(sgn*longitude);111 y[i] = -rho * (double)sgn * cos((double)sgn*longitude); 112 x[i] = rho * (double)sgn * sin((double)sgn*longitude); 113 113 114 114 if (latitude >= pi / 2.) { 115 115 x[i] = 0.0; 116 116 y[i] = 0.0; 117 iret=1; 117 118 } 118 119 } 119 120 120 return( 0);121 return(iret); 121 122 } 122 123 -
issm/trunk/src/c/modules/Xy2llx/Xy2llx.cpp
r8673 r8689 29 29 30 30 double delta,slat; 31 bool flag= false;31 bool flag=true; 32 32 33 33 /* Get central_meridian and standard_parallel depending on hemisphere */ … … 35 35 delta = 45; 36 36 slat = 70; 37 _printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 70N Meridian: 45) ");37 _printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 70N Meridian: 45).\n"); 38 38 } 39 39 else if (sgn == -1) { 40 40 delta = 0; 41 41 slat = 71; 42 _printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0) ");42 _printf_(flag,"Warning: expecting coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n"); 43 43 } 44 44 else 45 _error_("Sign should be either +1 or -1 ");45 _error_("Sign should be either +1 or -1.\n"); 46 46 47 47 return(Xy2llx(lat,lon, … … 70 70 */ 71 71 72 int i ;72 int i,iret=0; 73 73 double delta,slat; 74 74 double cde,re,ex2,ex,pi; … … 76 76 77 77 if ((sgn != 1) && (sgn != -1)) 78 _error_("Sign should be either +1 or -1 ");78 _error_("Sign should be either +1 or -1.\n"); 79 79 80 80 delta = central_meridian; … … 117 117 lat[i] = 90. * (double)sgn; 118 118 lon[i] = 0.0; 119 iret=1; 119 120 } 120 121 … … 124 125 } 125 126 126 return( 0);127 return(iret); 127 128 } 128 129 -
issm/trunk/src/mex/Ll2xy/Ll2xy.cpp
r8681 r8689 18 18 /* output: */ 19 19 double *x=NULL,*y=NULL; 20 int iret=0; 20 21 21 22 /*Boot module: */ … … 38 39 if (nlat == 1) printf(" lat=%g\n",lat[0]); 39 40 else printf(" lat=[%d values]\n",nlat); 41 // for (i=0; i<nlat; i++) printf(" lat[%d]=%g\n",i,lat[i]); 40 42 FetchData(&lon,&nlon,LON_IN); 41 43 if (verbose) 42 44 if (nlon == 1) printf(" lon=%g\n",lon[0]); 43 45 else printf(" lon=[%d values]\n",nlon); 46 // for (i=0; i<nlon; i++) printf(" lon[%d]=%g\n",i,lon[i]); 44 47 FetchData(&sgn,SGN_IN); 45 48 if (verbose) printf(" sgn=%d\n",sgn); … … 71 74 if (verbose) printf("Calling core:\n"); 72 75 if (options->GetOption("central_meridian") && options->GetOption("standard_parallel")) 73 Ll2xyx(x,y,74 75 76 iret=Ll2xyx(x,y, 77 lat,lon,ncoord, 78 sgn,cm,sp); 76 79 else 77 Ll2xyx(x,y, 78 lat,lon,ncoord, 79 sgn); 80 iret=Ll2xyx(x,y, 81 lat,lon,ncoord, 82 sgn); 83 if (verbose) printf(" iret=%d\n",iret); 80 84 81 85 /*Write data: */ -
issm/trunk/src/mex/Xy2ll/Xy2ll.cpp
r8681 r8689 18 18 /* output: */ 19 19 double *lat=NULL,*lon=NULL; 20 int iret=0; 20 21 21 22 /*Boot module: */ … … 38 39 if (nx == 1) printf(" x=%g\n",x[0]); 39 40 else printf(" x=[%d values]\n",nx); 41 // for (i=0; i<nx; i++) printf(" x[%d]=%g\n",i,x[i]); 40 42 FetchData(&y,&ny,Y_IN); 41 43 if (verbose) 42 44 if (ny == 1) printf(" y=%g\n",y[0]); 43 45 else printf(" y=[%d values]\n",ny); 46 // for (i=0; i<ny; i++) printf(" y[%d]=%g\n",i,y[i]); 44 47 FetchData(&sgn,SGN_IN); 45 48 if (verbose) printf(" sgn=%d\n",sgn); … … 71 74 if (verbose) printf("Calling core:\n"); 72 75 if (options->GetOption("central_meridian") && options->GetOption("standard_parallel")) 73 Xy2llx(lat,lon,74 75 76 iret=Xy2llx(lat,lon, 77 x,y,ncoord, 78 sgn,cm,sp); 76 79 else 77 Xy2llx(lat,lon, 78 x,y,ncoord, 79 sgn); 80 iret=Xy2llx(lat,lon, 81 x,y,ncoord, 82 sgn); 83 if (verbose) printf(" iret=%d\n",iret); 80 84 81 85 /*Write data: */
Note:
See TracChangeset
for help on using the changeset viewer.