Changeset 7
- Timestamp:
- 03/07/11 11:49:01 (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/meshmask.h
r6 r7 1 #define nav_lon( i, j ) (nav_lon[(j)*(NX)+(i)]) 2 #define nav_lat( i, j ) (nav_lat[(j)*(NX)+(i)]) 1 3 #define e1u( i, j ) (e1u[(j)*(NX)+(i)]) 2 4 #define e2u( i, j ) (e2u[(j)*(NX)+(i)]) … … 20 22 // tous les indices commencent de 0 21 23 //domzgr_substitute.h90 key_zco 24 # define nav_lev( i , j , k ) nav_lev[k] 22 25 # define fsdept( i , j , k ) gdept_0[k] 23 26 # define fsdepw( i , j , k ) gdepw_0[k] … … 52 55 # define fsahmv(i,j,k) ahm0 53 56 57 double nav_lon[NY*NX]; // from mesh_mask.nc 58 double nav_lat[NY*NX]; // from mesh_mask.nc 54 59 double e1u[NY*NX]; // from mesh_mask.nc 55 60 double e2u[NY*NX]; // from mesh_mask.nc … … 60 65 double e1f[NY*NX]; // from mesh_mask.nc 61 66 double e2f[NY*NX]; // from mesh_mask.nc 67 double nav_lev[NZ]; // from mesh_mask.nc 62 68 double e3t_0[NZ]; // from mesh_mask.nc 63 69 double e3w_0[NZ]; // from mesh_mask.nc … … 81 87 char const *mesh_mask_file = PATH_NCFILES"/mesh_mask.nc"; 82 88 int mesh_mask_file_id; 89 int nav_lon_id, nav_lat_id, nav_lev_id; //Utiliser juste pour info 83 90 int e1u_id,e2u_id,e1v_id,e2v_id,e1t_id,e2t_id,e1f_id,e2f_id,e3t_0_id,e3w_0_id; 84 91 int mbathy_id,gphit_id,gphiu_id,gphiv_id,gphif_id,gdept_0_id,gdepw_0_id; … … 106 113 107 114 115 108 116 //Ecriture du netcdf 109 117 void write_rst_global_att(int ncid); //Ecrit les attributs globaux du restart standard 110 118 void voncwrite(int t,int znbval,int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]); 119 void soncwrite(int t,int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]); 120 void zoncwrite(int t,int znbval,char const *var_name,int ncid,int dimids[], YREAL vect[]); 121 void zncwrite(int znbval,char const *var_name,int ncid,int dimids[], YREAL vect[]); 122 void sncwrite(int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]); 111 123 void define_dim(int ncid, int dimid[]); 112 124 //défini les dimensions en x,y,z, et t (unlimited), … … 119 131 mesh_mask_file_id=Ouvre_nc(mesh_mask_file); 120 132 133 nav_lon_id=Var_id(mesh_mask_file_id,"nav_lon"); 134 snclire(NY,NX, mesh_mask_file_id, nav_lon_id,nav_lon); 135 136 nav_lat_id=Var_id(mesh_mask_file_id,"nav_lat"); 137 snclire(NY,NX, mesh_mask_file_id, nav_lat_id,nav_lat); 138 121 139 e1u_id=Var_id(mesh_mask_file_id,"e1u"); 122 140 sonclire(0, NY,NX, mesh_mask_file_id, e1u_id,e1u); … … 181 199 bmask_id=Var_id(mesh_mask_file_id,"bmask"); 182 200 sonclire(0, NY,NX, mesh_mask_file_id, bmask_id,bmask); 201 202 nav_lev_id=Var_id(mesh_mask_file_id,"nav_lev"); 203 znclire(NZ, mesh_mask_file_id, nav_lev_id,nav_lev); 183 204 184 205 gdept_0_id=Var_id(mesh_mask_file_id,"gdept_0"); … … 358 379 //dimid={t_id,z_id,y_id,x_id}; 359 380 { 360 381 nc_redef(ncid); 361 382 nc_def_dim(ncid,"x",NX,&dimid[3]); 362 383 nc_def_dim(ncid,"y",NY,&dimid[2]); 363 384 nc_def_dim(ncid,"z",NZ,&dimid[1]); 364 385 nc_def_dim(ncid,"t",NC_UNLIMITED,&dimid[0]); 365 386 nc_enddef(ncid); 366 387 367 388 368 389 } 390 391 void write_rst_var(int t, int ncid, int dimids[]) { 392 YREAL vect[NZ*NY*NX]; 393 394 //nav_lon 395 for(int j=0;j<NY;j++) 396 for(int i=0;i<NX;i++){ 397 vect[(j)*(NX)+(i)]=nav_lon( i, j ); 398 } 399 sncwrite(NY,NX,"nav_lon",ncid,dimids,vect); 400 401 //nav_lat 402 for(int j=0;j<NY;j++) 403 for(int i=0;i<NX;i++){ 404 vect[(j)*(NX)+(i)]=nav_lat( i, j ); 405 } 406 sncwrite(NY,NX,"nav_lat",ncid,dimids,vect); 407 408 //nav_lev 409 for(int k=0;k<NZ;k++){ 410 vect[k]=nav_lev[k]; 411 } 412 zncwrite(NZ,"nav_lev",ncid,dimids,vect); 413 414 //gcx 415 for(int j=0;j<NY;j++) 416 for(int i=0;i<NX;i++){ 417 vect[(j)*(NX)+(i)]=YS_gcx2(0,i,j,t); 418 } 419 soncwrite(0,NY,NX,"gcx",ncid,dimids,vect); 420 421 //gcxb 422 for(int j=0;j<NY;j++) 423 for(int i=0;i<NX;i++){ 424 vect[(j)*(NX)+(i)]=YS_gcx2(0,i,j,t-1); 425 } 426 soncwrite(0,NY,NX,"gcxb",ncid,dimids,vect); 427 428 //sshb 429 for(int j=0;j<NY;j++) 430 for(int i=0;i<NX;i++){ 431 vect[(j)*(NX)+(i)]=YS_sshb(0,i,j,t); 432 } 433 soncwrite(0,NY,NX,"sshb",ncid,dimids,vect); 434 435 //sshn 436 for(int j=0;j<NY;j++) 437 for(int i=0;i<NX;i++){ 438 vect[(j)*(NX)+(i)]=YS_sshn(0,i,j,t); 439 } 440 soncwrite(0,NY,NX,"sshn",ncid,dimids,vect); 441 442 //ub 443 for(int k=0;k<NZ;k++) 444 for(int j=0;j<NY;j++) 445 for(int i=0;i<NX;i++){ 446 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_ub(0,i,j,k,t); 447 } 448 voncwrite(0,NZ,NY,NX,"ub",ncid,dimids,vect); 449 450 //vb 451 for(int k=0;k<NZ;k++) 452 for(int j=0;j<NY;j++) 453 for(int i=0;i<NX;i++){ 454 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_vb(0,i,j,k,t); 455 } 456 voncwrite(0,NZ,NY,NX,"vb",ncid,dimids,vect); 457 458 //tb 459 for(int k=0;k<NZ;k++) 460 for(int j=0;j<NY;j++) 461 for(int i=0;i<NX;i++){ 462 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_tb(0,i,j,k,t); 463 } 464 voncwrite(0,NZ,NY,NX,"tb",ncid,dimids,vect); 465 466 //sb 467 for(int k=0;k<NZ;k++) 468 for(int j=0;j<NY;j++) 469 for(int i=0;i<NX;i++){ 470 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_sb(0,i,j,k,t); 471 } 472 voncwrite(0,NZ,NY,NX,"sb",ncid,dimids,vect); 473 474 //rotb 475 for(int k=0;k<NZ;k++) 476 for(int j=0;j<NY;j++) 477 for(int i=0;i<NX;i++){ 478 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_rotn(0,i,j,k,t-1); 479 } 480 voncwrite(0,NZ,NY,NX,"rotb",ncid,dimids,vect); 481 482 //hdivb 483 for(int k=0;k<NZ;k++) 484 for(int j=0;j<NY;j++) 485 for(int i=0;i<NX;i++){ 486 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_hdivn(0,i,j,k,t-1); 487 } 488 voncwrite(0,NZ,NY,NX,"hdivb",ncid,dimids,vect); 489 490 //un 491 for(int k=0;k<NZ;k++) 492 for(int j=0;j<NY;j++) 493 for(int i=0;i<NX;i++){ 494 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_ua(0,i,j,k,t); 495 } 496 voncwrite(0,NZ,NY,NX,"un",ncid,dimids,vect); 497 498 //vn 499 for(int k=0;k<NZ;k++) 500 for(int j=0;j<NY;j++) 501 for(int i=0;i<NX;i++){ 502 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_va(0,i,j,k,t); 503 } 504 voncwrite(0,NZ,NY,NX,"vn",ncid,dimids,vect); 505 506 //tn 507 for(int k=0;k<NZ;k++) 508 for(int j=0;j<NY;j++) 509 for(int i=0;i<NX;i++){ 510 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_ta(0,i,j,k,t); 511 } 512 voncwrite(0,NZ,NY,NX,"tn",ncid,dimids,vect); 513 514 //sn 515 for(int k=0;k<NZ;k++) 516 for(int j=0;j<NY;j++) 517 for(int i=0;i<NX;i++){ 518 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_sa(0,i,j,k,t); 519 } 520 voncwrite(0,NZ,NY,NX,"sn",ncid,dimids,vect); 521 522 //rotn 523 for(int k=0;k<NZ;k++) 524 for(int j=0;j<NY;j++) 525 for(int i=0;i<NX;i++){ 526 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_rotn(0,i,j,k,t); 527 } 528 voncwrite(0,NZ,NY,NX,"rotn",ncid,dimids,vect); 529 530 //hdivn 531 for(int k=0;k<NZ;k++) 532 for(int j=0;j<NY;j++) 533 for(int i=0;i<NX;i++){ 534 vect[(k)*(NY*NX)+(j)*(NX)+(i)]=YS_hdivn(0,i,j,k,t); 535 } 536 voncwrite(0,NZ,NY,NX,"hdivn",ncid,dimids,vect); 537 538 539 } 540 541 369 542 370 543 void write_rst_global_att(int ncid) { -
trunk/include/ncutil.cpp
r4 r7 50 50 return(var_id); 51 51 } 52 52 53 void voncwrite(int t,int znbval,int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]) 54 { //Ecrrire le volume 3D au temps t 55 //le parametre t commence de 0. 56 // ecrit la variable var_name aux points (t, 1:znbval, 1:ynbval, 1:xnbval) 57 int status; 58 59 int var_id; 60 int local_dimids[4]; 61 static size_t start[] = {0,0,0,0}; //3D+t 62 static size_t count[] = {1,1,1,1}; //3D+t 63 count[0]= (size_t) t+1; 64 count[1]= (size_t) znbval; 65 count[2]= (size_t) ynbval; 66 count[3]= (size_t) xnbval; 67 start[0]=t; //temps commence de 0; 68 69 local_dimids[0]=dimids[0]; //t 70 local_dimids[1]=dimids[1]; //z 71 local_dimids[2]=dimids[2]; //y 72 local_dimids[3]=dimids[3]; //x 73 74 //Define the netCDF variable 75 status=nc_redef(ncid); 76 if (status != NC_NOERR) 77 { 78 handle_error (status, "Erreur change to def mode NetCDF ::voncwrite"); 79 } 80 81 status=nc_def_var(ncid,var_name,NC_REAL,4,local_dimids,&var_id); 82 83 if (status != NC_NOERR) 84 { 85 printf("variable %s:",var_name); 86 handle_error (status, "Erreur define NetCDF variable ::voncwrite"); 87 } 88 nc_enddef(ncid); 89 status=nc_put_vara_real(ncid,var_id,start,count,vect); 90 if (status != NC_NOERR) 91 { 92 handle_error (status, "Erreur writing NetCDF variable ::voncwrite"); 93 } 94 } 95 53 96 void vonclire(int t,int znbval, int ynbval, int xnbval, int ncid, int varid, double vect[]) 54 97 {// lire volume 3D au temps t … … 76 119 } 77 120 121 void soncwrite(int t,int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]) 122 { //Ecrrire le volume 2D au temps t 123 //le parametre t commence de 0. 124 // ecrit la variable var_name aux points (t, 1:ynbval, 1:xnbval) 125 int status; 126 127 int var_id; 128 int local_dimids[3]; 129 static size_t start[] = {0,0,0}; //2D+t 130 static size_t count[] = {1,1,1}; //2D+t 131 count[0]= (size_t) t+1; 132 count[1]= (size_t) ynbval; 133 count[2]= (size_t) xnbval; 134 start[0]=t; //temps commence de 0; 135 136 local_dimids[0]=dimids[0]; //t 137 local_dimids[1]=dimids[2]; //y 138 local_dimids[2]=dimids[3]; //x 139 140 //Define the netCDF variable 141 status=nc_redef(ncid); 142 if (status != NC_NOERR) 143 { 144 handle_error (status, "Erreur change to def mode NetCDF ::voncwrite"); 145 } 146 147 status=nc_def_var(ncid,var_name,NC_REAL,3,local_dimids,&var_id); 148 149 if (status != NC_NOERR) 150 { 151 printf("variable %s:",var_name); 152 handle_error (status, "Erreur define NetCDF variable ::voncwrite"); 153 } 154 nc_enddef(ncid); 155 status=nc_put_vara_real(ncid,var_id,start,count,vect); 156 if (status != NC_NOERR) 157 { 158 handle_error (status, "Erreur writing NetCDF variable ::voncwrite"); 159 } 160 } 161 162 78 163 void sonclire(int t,int ynbval, int xnbval, int ncid, int varid, double vect[]) 79 164 {// lire surface 2D au temps t … … 99 184 } 100 185 } 186 101 187 void sonclire(int t,int ynbval, int xnbval, int ncid, int varid, float vect[]) 102 188 {// lire surface 2D au temps t … … 123 209 } 124 210 211 void snclire(int ynbval, int xnbval, int ncid, int varid, double vect[]) 212 {// lire surface 2D 213 // (ynbval,xnbval,ncid, varid): 214 // lit la variable varid aux points (1:ynbval,1:xnbval) et 215 // renvoie un vecteur de dim ynbval*xnbval 216 217 int status; 218 static size_t start[] = { 0, 0 }; // 2D 219 static size_t count[] = { 1, 1 }; // 2D 220 count[0] =(size_t) ynbval; 221 count[1] =(size_t) xnbval; 222 223 // Read an array of values 224 status = nc_get_vara_double (ncid, varid, start, count, vect); 225 226 if (status != NC_NOERR) 227 { 228 handle_error (status, "Erreur lecture fichier NetCDF::snclire"); 229 } 230 } 231 232 void snclire(int ynbval, int xnbval, int ncid, int varid, float vect[]) 233 {// lire surface 2D 234 // (ynbval,xnbval,ncid, varid): 235 // lit la variable varid aux points (1:ynbval,1:xnbval) et 236 // renvoie un vecteur de dim ynbval*xnbval 237 238 int status; 239 static size_t start[] = { 0, 0 }; // 2D 240 static size_t count[] = { 1, 1 }; // 2D 241 count[0] =(size_t) ynbval; 242 count[1] =(size_t) xnbval; 243 244 // Read an array of values 245 status = nc_get_vara_float (ncid, varid, start, count, vect); 246 247 if (status != NC_NOERR) 248 { 249 handle_error (status, "Erreur lecture fichier NetCDF::snclire"); 250 } 251 } 252 253 void zoncwrite(int t,int znbval,char const *var_name,int ncid,int dimids[], YREAL vect[]) 254 { //Ecrrire la variable 1D au temps t 255 //le parametre t commence de 0. 256 // ecrit la variable var_name aux points (t, 1:znbval) 257 int status; 258 259 int var_id; 260 int local_dimids[2]; 261 static size_t start[] = {0,0}; //1D+t 262 static size_t count[] = {1,1}; //1D+t 263 count[0]= (size_t) t+1; 264 count[1]= (size_t) znbval; 265 266 start[0]=t; //temps commence de 0; 267 268 local_dimids[0]=dimids[0]; //t 269 local_dimids[1]=dimids[1]; //z 270 271 272 //Define the netCDF variable 273 status=nc_redef(ncid); 274 if (status != NC_NOERR) 275 { 276 handle_error (status, "Erreur change to def mode NetCDF ::voncwrite"); 277 } 278 279 status=nc_def_var(ncid,var_name,NC_REAL,2,local_dimids,&var_id); 280 281 if (status != NC_NOERR) 282 { 283 printf("variable %s:",var_name); 284 handle_error (status, "Erreur define NetCDF variable ::voncwrite"); 285 } 286 nc_enddef(ncid); 287 status=nc_put_vara_real(ncid,var_id,start,count,vect); 288 if (status != NC_NOERR) 289 { 290 handle_error (status, "Erreur writing NetCDF variable ::voncwrite"); 291 } 292 } 293 294 125 295 void zonclire(int t,int znbval, int ncid, int varid, double vect[]) 126 296 {// lire surface 1D au temps t … … 218 388 } 219 389 } 390 391 void znclire(int znbval, int ncid, int varid, double vect[]) 392 {// lire surface 1D 393 // (znbval,ncid, varid): 394 // lit la variable varid aux points (1:znbval) et 395 // renvoie un vecteur de dim znbval 396 397 int status; 398 static size_t start[] = { 0 }; //1D 399 static size_t count[] = { 1 }; // 1D 400 count[0] =(size_t) znbval; 401 402 403 // Read an array of values 404 status = nc_get_vara_double (ncid, varid, start, count, vect); 405 406 if (status != NC_NOERR) 407 { 408 handle_error (status, "Erreur lecture fichier NetCDF::zonclire"); 409 } 410 } 411 412 413 void znclire(int znbval, int ncid, int varid, float vect[]) 414 {// lire surface 1D 415 // (znbval,ncid, varid): 416 // lit la variable varid aux points (1:znbval) et 417 // renvoie un vecteur de dim znbval 418 419 int status; 420 static size_t start[] = { 0 }; //1D 421 static size_t count[] = { 1 }; // 1D 422 count[0] =(size_t) znbval; 423 424 425 // Read an array of values 426 status = nc_get_vara_float (ncid, varid, start, count, vect); 427 428 if (status != NC_NOERR) 429 { 430 handle_error (status, "Erreur lecture fichier NetCDF::zonclire"); 431 } 432 } 433 434 void sncwrite(int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]) 435 { //Ecrrire le volume 2D 436 // ecrit la variable var_name aux points (1:ynbval, 1:xnbval) 437 int status; 438 439 int var_id; 440 int local_dimids[2]; 441 static size_t start[] = {0,0}; //2D 442 static size_t count[] = {1,1}; //2D 443 count[0]= (size_t) ynbval; 444 count[1]= (size_t) xnbval; 445 446 local_dimids[0]=dimids[2]; //y 447 local_dimids[1]=dimids[3]; //x 448 449 //Define the netCDF variable 450 status=nc_redef(ncid); 451 if (status != NC_NOERR) 452 { 453 handle_error (status, "Erreur change to def mode NetCDF ::voncwrite"); 454 } 455 456 status=nc_def_var(ncid,var_name,NC_REAL,2,local_dimids,&var_id); 457 458 if (status != NC_NOERR) 459 { 460 printf("variable %s:",var_name); 461 handle_error (status, "Erreur define NetCDF variable ::voncwrite"); 462 } 463 nc_enddef(ncid); 464 status=nc_put_vara_real(ncid,var_id,start,count,vect); 465 if (status != NC_NOERR) 466 { 467 handle_error (status, "Erreur writing NetCDF variable ::voncwrite"); 468 } 469 } 470 471 472 void zncwrite(int znbval,char const *var_name,int ncid,int dimids[], YREAL vect[]) 473 { //Ecrrire la variable 1D 474 // ecrit la variable var_name aux points (1:znbval) 475 int status; 476 477 int var_id; 478 int local_dimids[1]; 479 static size_t start[] = {0}; //1D 480 static size_t count[] = {1}; //1D 481 482 count[0]= (size_t) znbval; 483 484 485 local_dimids[0]=dimids[1]; //z 486 487 488 //Define the netCDF variable 489 status=nc_redef(ncid); 490 if (status != NC_NOERR) 491 { 492 handle_error (status, "Erreur change to def mode NetCDF ::voncwrite"); 493 } 494 495 status=nc_def_var(ncid,var_name,NC_REAL,1,local_dimids,&var_id); 496 497 if (status != NC_NOERR) 498 { 499 printf("variable %s:",var_name); 500 handle_error (status, "Erreur define NetCDF variable ::voncwrite"); 501 } 502 nc_enddef(ncid); 503 status=nc_put_vara_real(ncid,var_id,start,count,vect); 504 if (status != NC_NOERR) 505 { 506 handle_error (status, "Erreur writing NetCDF variable ::voncwrite"); 507 } 508 } -
trunk/include/ncutil.h
r4 r7 8 8 #include <netcdf.h> 9 9 10 #define YYDOUBLE //équivalent du YDOUBLE/YFLOAT de YAO 11 //normalement YYDOUBLE et YBOUBLE doivent être définis en même temps 12 //Verifié dans appli_start 13 14 15 #ifdef YFLOAT 16 #define NC_REAL NC_FLOAT 17 #define nc_put_vara_real nc_put_vara_float 18 #define YREAL float 19 #else 20 #define NC_REAL NC_DOUBLE 21 #define nc_put_vara_real nc_put_vara_double 22 #define YREAL double 23 #endif 10 24 11 25 void handle_error (int status, char *txt);///*fonction de message d'erreur … … 23 37 // renvoie un vecteur de dim znbval*ynbval*xnbval 24 38 39 void voncwrite(int t,int znbval,int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]); 40 41 25 42 void sonclire(int t,int ynbval, int xnbval, int ncid, int varid, double vect[]); 26 43 void sonclire(int t,int ynbval, int xnbval, int ncid, int varid, float vect[]); … … 31 48 // lit la variable varid aux points (t,1:ynbval,1:xnbval) et 32 49 // renvoie un vecteur de dim ynbval*xnbval 50 void snclire(int ynbval, int xnbval, int ncid, int varid, float vect[]); 51 void snclire(int ynbval, int xnbval, int ncid, int varid, double vect[]); 52 53 void soncwrite(int t,int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]); 33 54 34 55 void zonclire(int t,int znbval, int ncid, int varid, double vect[]); … … 40 61 // renvoie un vecteur de dim znbval 41 62 63 void znclire(int znbval, int ncid, int varid, float vect[]); 64 void znclire(int znbval, int ncid, int varid, double vect[]); 65 66 void zoncwrite(int t,int znbval,char const *var_name,int ncid,int dimids[], YREAL vect[]); 67 68 void zncwrite(int znbval,char const *var_name,int ncid,int dimids[], YREAL vect[]); 69 void sncwrite(int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]); 42 70 #endif 43 71 -
trunk/src/sinobad.d
r3 r7 15 15 #HAT_NAME -----------------------------------------HAT_NAME 16 16 hat_name sinobad 17 17 18 18 #OPTION ----------------------------------------------OPTION 19 19 #option o_parallel … … 24 24 #option O_DBG_TING 25 25 option O_EXTOBJ "../object/ncutil.o" 26 option O_REAL double 26 27 27 28 #TRAJECTOIRES (DIM) -----------------------------------TRAJ -
trunk/src/sinobad.h
r6 r7 91 91 printf("////////////////////////////////////////////////////////////////////////\n"); 92 92 printf("// NEMO/YAO PROJECT //\n"); 93 printf("// M. Berrada 93 printf("// M. Berrada 02-2009 //\n"); 94 94 printf("// LOCEAN-IPSL.UPMC (Paris 6) //\n"); 95 95 printf("//====================================================================//\n"); 96 97 //Vérification du type de réel utilisé 98 #ifdef YFLOAT 99 #ifndef YYFLOAT 100 printf("Incoherent real type between O_REAL option and ncutil.h\n"); 101 exit(1); 102 #endif 103 #endif 104 #ifdef YDOUBLE 105 #ifndef YYDOUBLE 106 printf("Incoherent real type between O_REAL option and ncutil.h\n"); 107 exit(1); 108 #endif 109 #endif 110 96 111 for (int i=0;i<TA+TU;i++) tniter[i]=0;//nmax;// pour backward de solsor_dynspg_flt.h 97 112 phy_cst(); … … 844 859 int dimid[4]; 845 860 strcpy(rest_file,argv[1]); 846 rest_file_id=Ouvre_nc_write(rest_file); 847 write_rst_global_att(rest_file_id); 848 define_dim(rest_file_id,dimid); 849 nc_close( rest_file_id); 850 } 851 } 861 rest_file_id=Ouvre_nc_write(rest_file); //Ouvre le fichier netcds pour l'écriture 862 write_rst_global_att(rest_file_id); //Ecrit les global attributes 863 define_dim(rest_file_id,dimid); //Définit les dimensions 864 write_rst_var(TU,rest_file_id,dimid); //Ecrit les variables 865 nc_close( rest_file_id); //ferme le fichier 866 } 867 }
Note: See TracChangeset
for help on using the changeset viewer.