Changeset 1426 for trunk/UTIL
- Timestamp:
- May 11, 2015, 4:25:55 PM (10 years ago)
- Location:
- trunk/UTIL/SPECTRA
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/SPECTRA/readme
r1404 r1426 51 51 FC=pgf90 or ifort 52 52 53 for some machine, may load netcdf module: 54 module load netcdf 55 56 for ciclad machine, if using netcdf4: 57 in makefile change line 7 58 LDFLAGS=-L${netcdfpath}/lib -lnetcdf -L${spherepackpath}/lib -lspherepack 59 and replace by 60 LDFLAGS=-L${netcdfpath}/lib -lnetcdf -lnetcdff -L${spherepackpath}/lib -lspherepack 61 53 62 make spectra_analysis 54 63 … … 56 65 57 66 > compile test program 58 make test_ analysis67 make test_harmonic 59 68 60 69 > create harmonic winds 61 ./test_ analysis70 ./test_harmonic 62 71 63 > compute kinetic energy spectrum for one harmonic 72 >>>>> some examples 73 74 > compute kinetic energy spectrum for one harmonic test file 75 64 76 ./spectra_analysis harmonic_64x48_lmdz_22.nc -alt none -time none -o harmonic_64x48_lmdz_22_spectra 65 77 78 output file harmonic_64x48_lmdz_22_spectra contains: 79 first column -> harmonic numbers 80 second column -> amplitude of harmonic component, here only component 22 is non zero. 81 82 83 > compute kinetic energy spectrum with temporal and vertical mean 84 85 ./spectra_analysis diagfi.nc -t 5 -mt 10 -z 15 -mz 2 -o spectra 86 87 compute kinetic energy spectrum for t=5,6,...,15 and z=15,16,17 and average all spectra obtained. 88 89 90 > compute divergence and rotational part of kinetic energy spectrum 91 92 ./spectra_analysis diagfi.nc -t 5 -z 15 -o spectra -divrot 93 94 in spectra file, will find the rotationnal and divergent part of the decomposition of the velocity on the vectorial spherical harmonic basis: 95 #Spherical diagfi.nc 96 #wavenumber t= 150 z= 1 97 # spec_tot spec_div spec_rot 98 0 0.000000E+00 0.000000E+00 0.000000E+00 99 1 0.119347E+01 0.101938E+01 0.174095E+00 100 2 0.530388E+00 0.250037E+00 0.280350E+00 101 3 0.106973E+01 0.589848E+00 0.479880E+00 102 ... 103 104 105 >>>>> output interpretation 106 107 One can plot velocity projection against spherical wavenumber with gnuplot for instance. 108 In geostrophic turbulence, a n^-3 slope must appear for wavenumber n=1..100(?) and a n^-(5/3) slope for higher n. 109 110 111 >>>>> reference 112 J. N. Koshyk, 2001, The Horizontal Kinetic Energy Spectrum and Spectral Budget Simulated by a High-Resolution Troposphere–Stratosphere–Mesosphere GCM 113 114 115 116 117 118 -
trunk/UTIL/SPECTRA/spectra_analysis.f90
r1404 r1426 124 124 i = i + 1 125 125 elseif (arg(i) == '-h' .or. arg(i) == '--help') then 126 print*,'Usage\n spectra netcdfFile [option]\n [-h or --help]\t: brief help' 127 print*,'[-t int]\t: temporal indice (default: 1)\n [-z int]\t: vertical indice (default: 1)' 128 print*,'[-mt int]\t: extent of temporal mean (default: 0)\n [-mz int]\t: extent of vertical mean (default: 0)' 129 print*,'[-o str]\t: output spectra file name (default: spectra)' 130 print*,'[-u str]\t: name of zonal wind in netcdf file' 131 print*,'[-v str]\t: name of meridional wind in netcdf file' 132 print*,'[-lat str]\t: name of latitude field in netcdf file' 133 print*,'[-lon str]\t: name of longitude field in netcdf file' 134 print*,'[-alt str]\t: name of altitude field in netcdf file. ''none'' if no altitude axis.' 135 print*,'[-time str]\t: name of time field in netcdf file. ''none'' if no time axis.' 136 print*,'[-divrot]\t: total, divergence and vorticity spectra coefficient in output file' 126 print*,'Usage' 127 print*,'spectra_analysis netcdfFile [option]' 128 print*,'[-h or --help] : brief help' 129 print*,'[-t int] : temporal indice (default: 1)' 130 print*,'[-z int] : vertical indice (default: 1)' 131 print*,'[-mt int] : extent of temporal mean (default: 0)' 132 print*,'[-mz int] : extent of vertical mean (default: 0)' 133 print*,'[-o str] : output spectra file name (default: spectra)' 134 print*,'[-u str] : name of zonal wind in netcdf file' 135 print*,'[-v str] : name of meridional wind in netcdf file' 136 print*,'[-lat str] : name of latitude field in netcdf file' 137 print*,'[-lon str] : name of longitude field in netcdf file' 138 print*,'[-alt str] : name of altitude field in netcdf file. ''none'' if no altitude axis.' 139 print*,'[-time str] : name of time field in netcdf file. ''none'' if no time axis.' 140 print*,'[-divrot] : total, divergence and vorticity spectra coefficient in output file' 141 print*,'' 142 print*,'Compute the kinetic energy spectrum of a wind field on a longitude-latitude grid.' 143 print*,'The grid must have a redundant point in longitude.' 144 print*,'Ideally the analysis works better on a symetric grid (2N points in longitude and N points in latitude).' 145 print*,'The output text file (called spectra by default) give the decomposition' 146 print*,'of the velocity on the vectorial spherical harmonic basis.' 137 147 stop 'End help' 138 148 else … … 475 485 spectra_c_global(:,number_global) = spectra_c(:) 476 486 487 !**********Some cleaning 488 deallocate(br) 489 deallocate(bi) 490 deallocate(cr) 491 deallocate(ci) 492 deallocate(wvhaec) 493 deallocate(dwork) 494 deallocate(work) 495 deallocate(norm) 496 deallocate(norm_b) 497 deallocate(norm_c) 498 deallocate(spectra) 499 deallocate(spectra_b) 500 deallocate(spectra_c) 501 deallocate(zonal_wind) 502 deallocate(merid_wind) 503 deallocate(zonal_wind_lmdz) 504 deallocate(merid_wind_lmdz) 505 477 506 !********** 478 507 !End of loop over time and altitude indices … … 516 545 end do 517 546 end do 518 write(10,*) ''547 write(10,*) 519 548 write(10,'(a11,a1)',advance='no') '#wavenumber',' ' 520 549 do t = 1,n_indt … … 523 552 end do 524 553 end do 525 write(10,*) ''554 write(10,*) 526 555 write(10,'(a1,a11)',advance='no') '#',' ' 527 556 do t = 1,n_indt … … 534 563 end do 535 564 end do 536 write(10,*) ''565 write(10,*) 537 566 !**********Writing file_spectra 538 567 do j=1,nLat 539 write(10,'(i5,a 7)',advance='no') j-1,' '568 write(10,'(i5,a6)',advance='no') j-1,' ' 540 569 do t = 1,n_indt 541 570 do z = 1,n_indz 542 571 number_config = (t-1)*n_indz+z 543 572 if (is_div_rot) then 544 write(10,'(e13.6E2,a 4,e13.6E2,a4,e13.6E2,a6)',advance='no') spectra_config(j,number_config),' ',&573 write(10,'(e13.6E2,a3,e13.6E2,a3,e13.6E2,a5)',advance='no') spectra_config(j,number_config),' ',& 545 574 spectra_b_config(j,number_config),' ',spectra_c_config(j,number_config),' ' 546 575 else 547 write(10,'(e13.6E2,a3 8)',advance='no') spectra_config(j,number_config),' '576 write(10,'(e13.6E2,a37)',advance='no') spectra_config(j,number_config),' ' 548 577 end if 549 578 end do 550 579 end do 551 if (j /= nlat) write(10,*) ''580 if (j /= nlat) write(10,*) 552 581 end do 553 582 close(10) 554 583 555 584 print *, "***SUCCESS writing ",trim(file_spectra) 556 deallocate(br) 557 deallocate(bi) 558 deallocate(cr) 559 deallocate(ci) 560 deallocate(wvhaec) 561 deallocate(dwork) 562 deallocate(work) 585 586 !***********Some cleaning 587 deallocate(spectra_config) 588 deallocate(spectra_b_config) 589 deallocate(spectra_c_config) 590 deallocate(spectra_global) 591 deallocate(spectra_b_global) 592 deallocate(spectra_c_global) 593 deallocate(tab_indt) 594 deallocate(tab_indz) 595 deallocate(tmp_tab_int) 596 deallocate(arg) 563 597 564 598 contains
Note: See TracChangeset
for help on using the changeset viewer.