libsim Versione 7.1.11

◆ vol7d_ana_write_unit()

subroutine vol7d_ana_write_unit ( type(vol7d_ana), intent(in)  this,
integer, intent(in)  unit 
)

This method writes on a Fortran file unit the contents of the object this.

The record can successively be read by the ::read_unit method. The method works both on formatted and unformatted files.

Parametri
[in]thisobject to be written
[in]unitunit where to write, it must be an opened Fortran file unit

Definizione alla linea 552 del file vol7d_ana_class.F90.

553! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
554! authors:
555! Davide Cesari <dcesari@arpa.emr.it>
556! Paolo Patruno <ppatruno@arpa.emr.it>
557
558! This program is free software; you can redistribute it and/or
559! modify it under the terms of the GNU General Public License as
560! published by the Free Software Foundation; either version 2 of
561! the License, or (at your option) any later version.
562
563! This program is distributed in the hope that it will be useful,
564! but WITHOUT ANY WARRANTY; without even the implied warranty of
565! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
566! GNU General Public License for more details.
567
568! You should have received a copy of the GNU General Public License
569! along with this program. If not, see <http://www.gnu.org/licenses/>.
570#include "config.h"
571
576MODULE vol7d_ana_class
577USE kinds
580IMPLICIT NONE
581
583INTEGER,PARAMETER :: vol7d_ana_lenident=20
584
589TYPE vol7d_ana
590 TYPE(geo_coord) :: coord
591 CHARACTER(len=vol7d_ana_lenident) :: ident
592END TYPE vol7d_ana
593
595TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
596
600INTERFACE init
601 MODULE PROCEDURE vol7d_ana_init
602END INTERFACE
603
606INTERFACE delete
607 MODULE PROCEDURE vol7d_ana_delete
608END INTERFACE
609
613INTERFACE OPERATOR (==)
614 MODULE PROCEDURE vol7d_ana_eq
615END INTERFACE
616
620INTERFACE OPERATOR (/=)
621 MODULE PROCEDURE vol7d_ana_ne
622END INTERFACE
623
624
629INTERFACE OPERATOR (>)
630 MODULE PROCEDURE vol7d_ana_gt
631END INTERFACE
632
637INTERFACE OPERATOR (<)
638 MODULE PROCEDURE vol7d_ana_lt
639END INTERFACE
640
645INTERFACE OPERATOR (>=)
646 MODULE PROCEDURE vol7d_ana_ge
647END INTERFACE
648
653INTERFACE OPERATOR (<=)
654 MODULE PROCEDURE vol7d_ana_le
655END INTERFACE
656
657
659INTERFACE c_e
660 MODULE PROCEDURE vol7d_ana_c_e
661END INTERFACE
662
665INTERFACE read_unit
666 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
667END INTERFACE
668
671INTERFACE write_unit
672 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
673END INTERFACE
674
675#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
676#define VOL7D_POLY_TYPES _ana
677#define ENABLE_SORT
678#include "array_utilities_pre.F90"
679
681INTERFACE to_char
682 MODULE PROCEDURE to_char_ana
683END INTERFACE
684
686INTERFACE display
687 MODULE PROCEDURE display_ana
688END INTERFACE
689
690CONTAINS
691
695SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
696TYPE(vol7d_ana),INTENT(INOUT) :: this
697REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
698REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
699CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
700INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
701INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
702
703CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
704IF (PRESENT(ident)) THEN
705 this%ident = ident
706ELSE
707 this%ident = cmiss
708ENDIF
709
710END SUBROUTINE vol7d_ana_init
711
712
714SUBROUTINE vol7d_ana_delete(this)
715TYPE(vol7d_ana),INTENT(INOUT) :: this
716
717CALL delete(this%coord)
718this%ident = cmiss
719
720END SUBROUTINE vol7d_ana_delete
721
722
723
724character(len=80) function to_char_ana(this)
725
726TYPE(vol7d_ana),INTENT(in) :: this
727
728to_char_ana="ANA: "//&
729 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
730 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
731 t2c(this%ident,miss="Missing ident")
732
733return
734
735end function to_char_ana
736
737
738subroutine display_ana(this)
739
740TYPE(vol7d_ana),INTENT(in) :: this
741
742print*, trim(to_char(this))
743
744end subroutine display_ana
745
746
747ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
748TYPE(vol7d_ana),INTENT(IN) :: this, that
749LOGICAL :: res
750
751res = this%coord == that%coord .AND. this%ident == that%ident
752
753END FUNCTION vol7d_ana_eq
754
755
756ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
757TYPE(vol7d_ana),INTENT(IN) :: this, that
758LOGICAL :: res
759
760res = .NOT.(this == that)
761
762END FUNCTION vol7d_ana_ne
763
764
765ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
766TYPE(vol7d_ana),INTENT(IN) :: this, that
767LOGICAL :: res
768
769res = this%ident > that%ident
770
771if ( this%ident == that%ident) then
772 res =this%coord > that%coord
773end if
774
775END FUNCTION vol7d_ana_gt
776
777
778ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
779TYPE(vol7d_ana),INTENT(IN) :: this, that
780LOGICAL :: res
781
782res = .not. this < that
783
784END FUNCTION vol7d_ana_ge
785
786
787ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
788TYPE(vol7d_ana),INTENT(IN) :: this, that
789LOGICAL :: res
790
791res = this%ident < that%ident
792
793if ( this%ident == that%ident) then
794 res = this%coord < that%coord
795end if
796
797END FUNCTION vol7d_ana_lt
798
799
800ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
801TYPE(vol7d_ana),INTENT(IN) :: this, that
802LOGICAL :: res
803
804res = .not. (this > that)
805
806END FUNCTION vol7d_ana_le
807
808
809
810ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
811TYPE(vol7d_ana),INTENT(IN) :: this
812LOGICAL :: c_e
813c_e = this /= vol7d_ana_miss
814END FUNCTION vol7d_ana_c_e
815
816
821SUBROUTINE vol7d_ana_read_unit(this, unit)
822TYPE(vol7d_ana),INTENT(out) :: this
823INTEGER, INTENT(in) :: unit
824
825CALL vol7d_ana_vect_read_unit((/this/), unit)
826
827END SUBROUTINE vol7d_ana_read_unit
828
829
834SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
835TYPE(vol7d_ana) :: this(:)
836INTEGER, INTENT(in) :: unit
837
838CHARACTER(len=40) :: form
839
840CALL read_unit(this%coord, unit)
841INQUIRE(unit, form=form)
842IF (form == 'FORMATTED') THEN
843 READ(unit,'(A)')this(:)%ident
844ELSE
845 READ(unit)this(:)%ident
846ENDIF
847
848END SUBROUTINE vol7d_ana_vect_read_unit
849
850
855SUBROUTINE vol7d_ana_write_unit(this, unit)
856TYPE(vol7d_ana),INTENT(in) :: this
857INTEGER, INTENT(in) :: unit
858
859CALL vol7d_ana_vect_write_unit((/this/), unit)
860
861END SUBROUTINE vol7d_ana_write_unit
862
863
868SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
869TYPE(vol7d_ana),INTENT(in) :: this(:)
870INTEGER, INTENT(in) :: unit
871
872CHARACTER(len=40) :: form
873
874CALL write_unit(this%coord, unit)
875INQUIRE(unit, form=form)
876IF (form == 'FORMATTED') THEN
877 WRITE(unit,'(A)')this(:)%ident
878ELSE
879 WRITE(unit)this(:)%ident
880ENDIF
881
882END SUBROUTINE vol7d_ana_vect_write_unit
883
884
885#include "array_utilities_inc.F90"
886
887
888END MODULE vol7d_ana_class
check for missing value
Distruttore per la classe vol7d_ana.
Costruttore per la classe vol7d_ana.
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED.
Represent ana object in a pretty string.
Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED.
Classes for handling georeferenced sparse points in geographical corodinates.
Definition of constants to be used for declaring variables of a desired type.
Definition: kinds.F90:251
Definitions of constants and functions for working with missing values.
Classe per la gestione dell'anagrafica di stazioni meteo e affini.
Definisce l'anagrafica di una stazione.

Generated with Doxygen.