Ignore:
Timestamp:
Jul 18, 2024, 4:57:05 PM (4 months ago)
Author:
abarral
Message:

Remove all NC_DOUBLE uses outside of lmdz_netcdf.F90 (except in obsolete/, which I hope we'll ditch soon...)
Note: make sure to check convergence at some point, it's possible that we've messed up some when replacing nf_* by nf90_* calls
(lint) replace obsolete logical operators along the way

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmdiso/phyaqua_mod.F90

    r4619 r5073  
    636636      dims(2) = ntim
    637637
    638 #ifdef NC_DOUBLE
    639       ierr = nf_def_var(nid, 'TEMPS', nf_double, 1, ntim, id_tim)
    640 #else
    641       ierr = nf_def_var(nid, 'TEMPS', nf_float, 1, ntim, id_tim)
    642 #endif
     638      ierr = nf_def_var(nid, 'TEMPS', NF90_FORMAT, 1, ntim, id_tim)
    643639      ierr = nf_put_att_text(nid, id_tim, 'title', 17, 'Jour dans l annee')
    644640
    645 #ifdef NC_DOUBLE
    646       ierr = nf_def_var(nid, 'NAT', nf_double, 2, dims, id_nat)
    647 #else
    648       ierr = nf_def_var(nid, 'NAT', nf_float, 2, dims, id_nat)
    649 #endif
     641      ierr = nf_def_var(nid, 'NAT', NF90_FORMAT, 2, dims, id_nat)
    650642      ierr = nf_put_att_text(nid, id_nat, 'title', 23, &
    651643        'Nature du sol (0,1,2,3)')
    652644
    653 #ifdef NC_DOUBLE
    654       ierr = nf_def_var(nid, 'SST', nf_double, 2, dims, id_sst)
    655 #else
    656       ierr = nf_def_var(nid, 'SST', nf_float, 2, dims, id_sst)
    657 #endif
     645      ierr = nf_def_var(nid, 'SST', NF90_FORMAT, 2, dims, id_sst)
    658646      ierr = nf_put_att_text(nid, id_sst, 'title', 35, &
    659647        'Temperature superficielle de la mer')
    660648
    661 #ifdef NC_DOUBLE
    662       ierr = nf_def_var(nid, 'BILS', nf_double, 2, dims, id_bils)
    663 #else
    664       ierr = nf_def_var(nid, 'BILS', nf_float, 2, dims, id_bils)
    665 #endif
     649      ierr = nf_def_var(nid, 'BILS', NF90_FORMAT, 2, dims, id_bils)
    666650      ierr = nf_put_att_text(nid, id_bils, 'title', 32, &
    667651        'Reference flux de chaleur au sol')
    668652
    669 #ifdef NC_DOUBLE
    670       ierr = nf_def_var(nid, 'ALB', nf_double, 2, dims, id_alb)
    671 #else
    672       ierr = nf_def_var(nid, 'ALB', nf_float, 2, dims, id_alb)
    673 #endif
     653      ierr = nf_def_var(nid, 'ALB', NF90_FORMAT, 2, dims, id_alb)
    674654      ierr = nf_put_att_text(nid, id_alb, 'title', 19, 'Albedo a la surface')
    675655
    676 #ifdef NC_DOUBLE
    677       ierr = nf_def_var(nid, 'RUG', nf_double, 2, dims, id_rug)
    678 #else
    679       ierr = nf_def_var(nid, 'RUG', nf_float, 2, dims, id_rug)
    680 #endif
     656      ierr = nf_def_var(nid, 'RUG', NF90_FORMAT, 2, dims, id_rug)
    681657      ierr = nf_put_att_text(nid, id_rug, 'title', 8, 'Rugosite')
    682658
    683 #ifdef NC_DOUBLE
    684       ierr = nf_def_var(nid, 'FTER', nf_double, 2, dims, id_fter)
    685 #else
    686       ierr = nf_def_var(nid, 'FTER', nf_float, 2, dims, id_fter)
    687 #endif
     659      ierr = nf_def_var(nid, 'FTER', NF90_FORMAT, 2, dims, id_fter)
    688660      ierr = nf_put_att_text(nid, id_fter, 'title',10,'Frac. Land')
    689 #ifdef NC_DOUBLE
    690       ierr = nf_def_var(nid, 'FOCE', nf_double, 2, dims, id_foce)
    691 #else
    692       ierr = nf_def_var(nid, 'FOCE', nf_float, 2, dims, id_foce)
    693 #endif
     661      ierr = nf_def_var(nid, 'FOCE', NF90_FORMAT, 2, dims, id_foce)
    694662      ierr = nf_put_att_text(nid, id_foce, 'title',11,'Frac. Ocean')
    695 #ifdef NC_DOUBLE
    696       ierr = nf_def_var(nid, 'FSIC', nf_double, 2, dims, id_fsic)
    697 #else
    698       ierr = nf_def_var(nid, 'FSIC', nf_float, 2, dims, id_fsic)
    699 #endif
     663      ierr = nf_def_var(nid, 'FSIC', NF90_FORMAT, 2, dims, id_fsic)
    700664      ierr = nf_put_att_text(nid, id_fsic, 'title',13,'Frac. Sea Ice')
    701 #ifdef NC_DOUBLE
    702       ierr = nf_def_var(nid, 'FLIC', nf_double, 2, dims, id_flic)
    703 #else
    704       ierr = nf_def_var(nid, 'FLIC', nf_float, 2, dims, id_flic)
    705 #endif
     665      ierr = nf_def_var(nid, 'FLIC', NF90_FORMAT, 2, dims, id_flic)
    706666      ierr = nf_put_att_text(nid, id_flic, 'title',14,'Frac. Land Ice')
    707667
     
    715675      ! write the 'times'
    716676      DO k = 1, year_len
    717 #ifdef NC_DOUBLE
    718         ierr = nf_put_var1_double(nid, id_tim, k, dble(k))
    719 #else
    720         ierr = nf_put_var1_real(nid, id_tim, k, float(k))
    721 #endif
     677        ierr = nf90_put_var(nid, id_tim, k, k)
    722678        IF (ierr/=nf_noerr) THEN
    723679          WRITE (*, *) 'writelim error with temps(k),k=', k
     
    732688    CALL gather(phy_nat, phy_glo)
    733689    IF (is_master) THEN
    734 #ifdef NC_DOUBLE
    735       ierr = nf_put_var_double(nid, id_nat, phy_glo)
    736 #else
    737       ierr = nf_put_var_real(nid, id_nat, phy_glo)
    738 #endif
     690      ierr = nf90_put_var(nid, id_nat, phy_glo)
    739691      IF (ierr/=nf_noerr) THEN
    740692        WRITE (*, *) 'writelim error with phy_nat'
     
    745697    CALL gather(phy_sst, phy_glo)
    746698    IF (is_master) THEN
    747 #ifdef NC_DOUBLE
    748       ierr = nf_put_var_double(nid, id_sst, phy_glo)
    749 #else
    750       ierr = nf_put_var_real(nid, id_sst, phy_glo)
    751 #endif
     699      ierr = nf90_put_var(nid, id_sst, phy_glo)
    752700      IF (ierr/=nf_noerr) THEN
    753701        WRITE (*, *) 'writelim error with phy_sst'
     
    758706    CALL gather(phy_bil, phy_glo)
    759707    IF (is_master) THEN
    760 #ifdef NC_DOUBLE
    761       ierr = nf_put_var_double(nid, id_bils, phy_glo)
    762 #else
    763       ierr = nf_put_var_real(nid, id_bils, phy_glo)
    764 #endif
     708      ierr = nf90_put_var(nid, id_bils, phy_glo)
    765709      IF (ierr/=nf_noerr) THEN
    766710        WRITE (*, *) 'writelim error with phy_bil'
     
    771715    CALL gather(phy_alb, phy_glo)
    772716    IF (is_master) THEN
    773 #ifdef NC_DOUBLE
    774       ierr = nf_put_var_double(nid, id_alb, phy_glo)
    775 #else
    776       ierr = nf_put_var_real(nid, id_alb, phy_glo)
    777 #endif
     717      ierr = nf90_put_var(nid, id_alb, phy_glo)
    778718      IF (ierr/=nf_noerr) THEN
    779719        WRITE (*, *) 'writelim error with phy_alb'
     
    784724    CALL gather(phy_rug, phy_glo)
    785725    IF (is_master) THEN
    786 #ifdef NC_DOUBLE
    787       ierr = nf_put_var_double(nid, id_rug, phy_glo)
    788 #else
    789       ierr = nf_put_var_real(nid, id_rug, phy_glo)
    790 #endif
     726      ierr = nf90_put_var(nid, id_rug, phy_glo)
    791727      IF (ierr/=nf_noerr) THEN
    792728        WRITE (*, *) 'writelim error with phy_rug'
     
    797733    CALL gather(phy_fter, phy_glo)
    798734    IF (is_master) THEN
    799 #ifdef NC_DOUBLE
    800       ierr = nf_put_var_double(nid, id_fter, phy_glo)
    801 #else
    802       ierr = nf_put_var_real(nid, id_fter, phy_glo)
    803 #endif
     735      ierr = nf90_put_var(nid, id_fter, phy_glo)
    804736      IF (ierr/=nf_noerr) THEN
    805737        WRITE (*, *) 'writelim error with phy_fter'
     
    810742    CALL gather(phy_foce, phy_glo)
    811743    IF (is_master) THEN
    812 #ifdef NC_DOUBLE
    813       ierr = nf_put_var_double(nid, id_foce, phy_glo)
    814 #else
    815       ierr = nf_put_var_real(nid, id_foce, phy_glo)
    816 #endif
     744      ierr = nf90_put_var(nid, id_foce, phy_glo)
    817745      IF (ierr/=nf_noerr) THEN
    818746        WRITE (*, *) 'writelim error with phy_foce'
     
    823751    CALL gather(phy_fsic, phy_glo)
    824752    IF (is_master) THEN
    825 #ifdef NC_DOUBLE
    826       ierr = nf_put_var_double(nid, id_fsic, phy_glo)
    827 #else
    828       ierr = nf_put_var_real(nid, id_fsic, phy_glo)
    829 #endif
     753      ierr = nf90_put_var(nid, id_fsic, phy_glo)
    830754      IF (ierr/=nf_noerr) THEN
    831755        WRITE (*, *) 'writelim error with phy_fsic'
     
    836760    CALL gather(phy_flic, phy_glo)
    837761    IF (is_master) THEN
    838 #ifdef NC_DOUBLE
    839       ierr = nf_put_var_double(nid, id_flic, phy_glo)
    840 #else
    841       ierr = nf_put_var_real(nid, id_flic, phy_glo)
    842 #endif
     762      ierr = nf90_put_var(nid, id_flic, phy_glo)
    843763      IF (ierr/=nf_noerr) THEN
    844764        WRITE (*, *) 'writelim error with phy_flic'
Note: See TracChangeset for help on using the changeset viewer.