Changeset 1404 for trunk/UTIL/SPECTRA


Ignore:
Timestamp:
Mar 31, 2015, 6:03:30 PM (10 years ago)
Author:
milmd
Message:

Add the opportunity to create some harmonical wind fields for testing. Spherepack library can also be compiled with ifort.

Location:
trunk/UTIL/SPECTRA
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/SPECTRA/makefile

    r1402 r1404  
    1212TMP=$(SRCS:=~)
    1313
     14all: spectra_analysis test_harmonic
     15
    1416%.o: %.f90
    1517        $(FC) $(FFLAGS) -c $<
  • trunk/UTIL/SPECTRA/readme

    r1402 r1404  
    1 >>>> install (64b) spherepack 3.2 library with pgf90
    2 (g95,ifort,gfortran... not  possible yet)
     1>>>> install spectra tool and spherepack 3.2 library with pgf90 or ifort
     2(g95,gfortran... not  possible yet)
    33
    44wget -c https://www2.cisl.ucar.edu/sites/default/files/spherepack3.2.tar
     
    66cd spherepack3.2
    77
    8 > install
    9 for pgf90, after discussion with Richard A. Valent (valent@ucar.edu), change line 12 of make.inc in spherepack3.2 folder:
    10 F90 := pgf90 -module ../lib -I../lib
     8>>>> install spherepack 3.2 library
     9>for pgf90, after discussion with Richard A. Valent (valent@ucar.edu), change line 12 of make.inc in spherepack3.2 folder:
     10  F90 := pgf90 -module ../lib -I../lib
    1111and replace by
    12 F90 := pgf90 -r8 -module ../lib -I../lib
     12  F90 := pgf90 -r8 -module ../lib -I../lib
    1313to run in double precision (better).
    1414
    15 make all > log_install 2>&1
     15>for ifort:
     16change line 10 to 20 of make.inc
     17  ifeq ($(PGI),pgf90-Warning-No files to process)
     18
     19    F90 := pgf90 -module ../lib -I../lib
     20    CPP := pgf90 -E
     21
     22  else
     23
     24    F90 := g95 -DG95 -g -fmod=../lib -I../lib
     25    CPP := g95 -E -DG95
     26
     27  endif
     28and replace by
     29  F90 := ifort -r8 -module ../lib -I../lib
     30  CPP := ifort -fpp
     31change line 16 of test/Makefile
     32        $(F90) $< -o $@ -L../lib -l spherepack
     33and replace by
     34        $(F90) $< -o $@ -L../lib -lspherepack
     35       
     36
     37> make all > log_install 2>&1
    1638
    1739> OK 'lib' ,... are in /planeto/milmd/library/spherepack/spherepack3.2_levan_pgf90
    1840
    1941
    20 >>>> compile spectra_analysis program with pgf90 or g95
     42>>>> compile spectra_analysis program with pgf90 or ifort
    2143
    2244cd ..
    2345
    2446change the first 3 lines of the makefile: path of spherepack library you have just installed, path of netcdf libray, compiler
    25 netcdfpath=/planeto/milmd/library/netcdf/netcdf-4.0.1_levan_pgf90
    26 spherepackpath=/planeto/milmd/library/spherepack/spherepack3.2_levan_pgf90
    27 FC=pgf90
     47netcdfpath=/planeto/milmd/library/netcdf/netcdf-4.0.1_levan_pgf90 (on levan)
     48netcdfpath=/smplocal/pub/NetCDF/4.1.3/seq (on ada)
     49netcdfpath=/usr/local (on gnome)
     50spherepackpath=/path/to/spherepack3.2
     51FC=pgf90 or ifort
    2852
    2953make spectra_analysis
     54
     55>>>>> test on some harmonic cases
     56
     57> compile test program
     58make test_analysis
     59
     60> create harmonic winds
     61./test_analysis
     62
     63> compute kinetic energy spectrum for one harmonic
     64./spectra_analysis harmonic_64x48_lmdz_22.nc -alt none -time none -o harmonic_64x48_lmdz_22_spectra
     65
  • trunk/UTIL/SPECTRA/spectra_analysis.f90

    r1402 r1404  
    132132      print*,'[-lat str]\t: name of latitude field in netcdf file'
    133133      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.'
     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.'
    136136      print*,'[-divrot]\t: total, divergence and vorticity spectra coefficient in output file'
    137137      stop 'End help'
     
    166166else
    167167  print*,'latitude dimension not found!'
    168   stop ' must have this... use \'-lat latitudefieldname\' option.'
     168  stop ' must have this... use ''-lat latitudefieldname'' option.'
    169169end if
    170170
     
    180180else
    181181  print*,'longitude dimension not found!'
    182   stop ' must have this... use \'-lon longitudefieldname\' option.'
     182  stop ' must have this... use ''-lon longitudefieldname'' option.'
    183183end if
    184184
     
    197197  else
    198198    print*,'altitude dimension not found!'
    199     stop ' if no altitude axis, use \'-alt none\' option...'
     199    stop ' if no altitude axis, use ''-alt none'' option...'
    200200  end if
    201201end if
     
    215215  else
    216216    print*,'time dimension not found!'
    217     stop ' if no time axis, use \'-time none\' option...'
     217    stop ' if no time axis, use ''-time none'' option...'
    218218  end if
    219219end if
     
    295295else
    296296  print*,'zonal wind variable not found!'
    297   stop ' must have this... use \'-u zonalwindfieldname\' option.'
     297  stop ' must have this... use ''-u zonalwindfieldname'' option.'
    298298end if
    299299
     
    324324else
    325325  print*,'meridional wind variable not found!'
    326   stop ' must have this... use \'-v meridionalwindfieldname\' option.'
     326  stop ' must have this... use ''-v meridionalwindfieldname'' option.'
    327327end if
    328328
     
    542542  number_config = (t-1)*n_indz+z
    543543  if (is_div_rot) then
    544     write(10,'(e12.6E2,a4,e12.6E2,a4,e12.6E2,a6)',advance='no') spectra_config(j,number_config),' ',&
     544    write(10,'(e13.6E2,a4,e13.6E2,a4,e13.6E2,a6)',advance='no') spectra_config(j,number_config),' ',&
    545545                        spectra_b_config(j,number_config),' ',spectra_c_config(j,number_config),' '
    546546  else
    547     write(10,'(e12.6E2,a38)',advance='no') spectra_config(j,number_config),' '
     547    write(10,'(e13.6E2,a38)',advance='no') spectra_config(j,number_config),' '
    548548  end if
    549549  end do
Note: See TracChangeset for help on using the changeset viewer.