libsim Versione 7.2.4
|
◆ vol7d_ana_vect_write_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.
Definizione alla linea 559 del file vol7d_ana_class.F90. 560! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
561! authors:
562! Davide Cesari <dcesari@arpa.emr.it>
563! Paolo Patruno <ppatruno@arpa.emr.it>
564
565! This program is free software; you can redistribute it and/or
566! modify it under the terms of the GNU General Public License as
567! published by the Free Software Foundation; either version 2 of
568! the License, or (at your option) any later version.
569
570! This program is distributed in the hope that it will be useful,
571! but WITHOUT ANY WARRANTY; without even the implied warranty of
572! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
573! GNU General Public License for more details.
574
575! You should have received a copy of the GNU General Public License
576! along with this program. If not, see <http://www.gnu.org/licenses/>.
577#include "config.h"
578
587IMPLICIT NONE
588
590INTEGER,PARAMETER :: vol7d_ana_lenident=20
591
597 TYPE(geo_coord) :: coord
598 CHARACTER(len=vol7d_ana_lenident) :: ident
600
603
608 MODULE PROCEDURE vol7d_ana_init
609END INTERFACE
610
614 MODULE PROCEDURE vol7d_ana_delete
615END INTERFACE
616
620INTERFACE OPERATOR (==)
621 MODULE PROCEDURE vol7d_ana_eq
622END INTERFACE
623
627INTERFACE OPERATOR (/=)
628 MODULE PROCEDURE vol7d_ana_ne
629END INTERFACE
630
631
636INTERFACE OPERATOR (>)
637 MODULE PROCEDURE vol7d_ana_gt
638END INTERFACE
639
644INTERFACE OPERATOR (<)
645 MODULE PROCEDURE vol7d_ana_lt
646END INTERFACE
647
652INTERFACE OPERATOR (>=)
653 MODULE PROCEDURE vol7d_ana_ge
654END INTERFACE
655
660INTERFACE OPERATOR (<=)
661 MODULE PROCEDURE vol7d_ana_le
662END INTERFACE
663
664
667 MODULE PROCEDURE vol7d_ana_c_e
668END INTERFACE
669
673 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
674END INTERFACE
675
679 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
680END INTERFACE
681
682#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
683#define VOL7D_POLY_TYPES _ana
684#define ENABLE_SORT
685#include "array_utilities_pre.F90"
686
689 MODULE PROCEDURE to_char_ana
690END INTERFACE
691
694 MODULE PROCEDURE display_ana
695END INTERFACE
696
697CONTAINS
698
702SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
703TYPE(vol7d_ana),INTENT(INOUT) :: this
704REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
705REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
706CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
707INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
708INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
709
711IF (PRESENT(ident)) THEN
712 this%ident = ident
713ELSE
714 this%ident = cmiss
715ENDIF
716
717END SUBROUTINE vol7d_ana_init
718
719
721SUBROUTINE vol7d_ana_delete(this)
722TYPE(vol7d_ana),INTENT(INOUT) :: this
723
725this%ident = cmiss
726
727END SUBROUTINE vol7d_ana_delete
728
729
730
731character(len=80) function to_char_ana(this)
732
733TYPE(vol7d_ana),INTENT(in) :: this
734
735to_char_ana="ANA: "//&
738 t2c(this%ident,miss="Missing ident")
739
740return
741
742end function to_char_ana
743
744
745subroutine display_ana(this)
746
747TYPE(vol7d_ana),INTENT(in) :: this
748
749print*, trim(to_char(this))
750
751end subroutine display_ana
752
753
754ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
755TYPE(vol7d_ana),INTENT(IN) :: this, that
756LOGICAL :: res
757
758res = this%coord == that%coord .AND. this%ident == that%ident
759
760END FUNCTION vol7d_ana_eq
761
762
763ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
764TYPE(vol7d_ana),INTENT(IN) :: this, that
765LOGICAL :: res
766
767res = .NOT.(this == that)
768
769END FUNCTION vol7d_ana_ne
770
771
772ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
773TYPE(vol7d_ana),INTENT(IN) :: this, that
774LOGICAL :: res
775
776res = this%ident > that%ident
777
778if ( this%ident == that%ident) then
779 res =this%coord > that%coord
780end if
781
782END FUNCTION vol7d_ana_gt
783
784
785ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
786TYPE(vol7d_ana),INTENT(IN) :: this, that
787LOGICAL :: res
788
789res = .not. this < that
790
791END FUNCTION vol7d_ana_ge
792
793
794ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
795TYPE(vol7d_ana),INTENT(IN) :: this, that
796LOGICAL :: res
797
798res = this%ident < that%ident
799
800if ( this%ident == that%ident) then
801 res = this%coord < that%coord
802end if
803
804END FUNCTION vol7d_ana_lt
805
806
807ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
808TYPE(vol7d_ana),INTENT(IN) :: this, that
809LOGICAL :: res
810
811res = .not. (this > that)
812
813END FUNCTION vol7d_ana_le
814
815
816
817ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
818TYPE(vol7d_ana),INTENT(IN) :: this
819LOGICAL :: c_e
820c_e = this /= vol7d_ana_miss
821END FUNCTION vol7d_ana_c_e
822
823
828SUBROUTINE vol7d_ana_read_unit(this, unit)
829TYPE(vol7d_ana),INTENT(out) :: this
830INTEGER, INTENT(in) :: unit
831
832CALL vol7d_ana_vect_read_unit((/this/), unit)
833
834END SUBROUTINE vol7d_ana_read_unit
835
836
841SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
842TYPE(vol7d_ana) :: this(:)
843INTEGER, INTENT(in) :: unit
844
845CHARACTER(len=40) :: form
846
848INQUIRE(unit, form=form)
849IF (form == 'FORMATTED') THEN
850 READ(unit,'(A)')this(:)%ident
851ELSE
852 READ(unit)this(:)%ident
853ENDIF
854
855END SUBROUTINE vol7d_ana_vect_read_unit
856
857
862SUBROUTINE vol7d_ana_write_unit(this, unit)
863TYPE(vol7d_ana),INTENT(in) :: this
864INTEGER, INTENT(in) :: unit
865
866CALL vol7d_ana_vect_write_unit((/this/), unit)
867
868END SUBROUTINE vol7d_ana_write_unit
869
870
875SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
876TYPE(vol7d_ana),INTENT(in) :: this(:)
877INTEGER, INTENT(in) :: unit
878
879CHARACTER(len=40) :: form
880
882INQUIRE(unit, form=form)
883IF (form == 'FORMATTED') THEN
884 WRITE(unit,'(A)')this(:)%ident
885ELSE
886 WRITE(unit)this(:)%ident
887ENDIF
888
889END SUBROUTINE vol7d_ana_vect_write_unit
890
891
892#include "array_utilities_inc.F90"
893
894
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED. Definition vol7d_ana_class.F90:301 Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED. Definition vol7d_ana_class.F90:307 Classes for handling georeferenced sparse points in geographical corodinates. Definition geo_coord_class.F90:216 Definition of constants to be used for declaring variables of a desired type. Definition kinds.F90:245 Definitions of constants and functions for working with missing values. Definition missing_values.f90:50 Classe per la gestione dell'anagrafica di stazioni meteo e affini. Definition vol7d_ana_class.F90:212 |